Feat: Update scanner persistence, more migrations and bugfixes

This commit is contained in:
Anton Stubenbord
2023-09-28 17:14:27 +02:00
parent 18ab657932
commit 653344c9ee
55 changed files with 887 additions and 442 deletions

View File

@@ -8,6 +8,7 @@ import 'package:paperless_api/paperless_api.dart';
import 'package:paperless_mobile/core/config/hive/hive_config.dart';
import 'package:paperless_mobile/core/database/tables/local_user_account.dart';
import 'package:paperless_mobile/core/exception/server_message_exception.dart';
import 'package:paperless_mobile/core/model/info_message_exception.dart';
import 'package:paperless_mobile/features/login/cubit/authentication_cubit.dart';
import 'package:paperless_mobile/features/login/model/client_certificate.dart';
import 'package:paperless_mobile/features/login/model/client_certificate_form_model.dart';
@@ -153,6 +154,8 @@ class _AddAccountPageState extends State<AddAccountPage> {
showErrorMessage(context, error);
} on ServerMessageException catch (error) {
showLocalizedError(context, error.message);
} on InfoMessageException catch (error) {
showInfoMessage(context, error);
} catch (error) {
showGenericError(context, error);
}

View File

@@ -52,10 +52,11 @@ class _ServerLoginPageState extends State<ServerLoginPage> {
Text(
S.of(context)!.loginRequiredPermissionsHint,
style: Theme.of(context).textTheme.bodySmall?.apply(
color: Theme.of(context)
.colorScheme
.onBackground
.withOpacity(0.6)),
color: Theme.of(context)
.colorScheme
.onBackground
.withOpacity(0.6),
),
).padded(16),
],
),
@@ -64,11 +65,16 @@ class _ServerLoginPageState extends State<ServerLoginPage> {
mainAxisAlignment: MainAxisAlignment.end,
children: [
FilledButton(
onPressed: () async {
setState(() => _isLoginLoading = true);
await widget.onSubmit();
setState(() => _isLoginLoading = false);
},
onPressed: !_isLoginLoading
? () async {
setState(() => _isLoginLoading = true);
try {
await widget.onSubmit();
} finally {
setState(() => _isLoginLoading = false);
}
}
: null,
child: Text(S.of(context)!.signIn),
)
],