fix(mobile): no album thumbnail lead to no album selection shown and add global logs ()

* fix(mobile): no album thumbnail lead to no album selection shown

* add more log info

* added global error handling

* better place to init logger

* get more log
This commit is contained in:
Alex 2023-02-23 00:36:17 -06:00 committed by GitHub
parent 98a8be82e2
commit a2549c5bbd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 112 additions and 88 deletions
mobile/lib

View file

@ -31,6 +31,7 @@ import 'package:immich_mobile/shared/views/version_announcement_overlay.dart';
import 'package:immich_mobile/utils/immich_app_theme.dart';
import 'package:immich_mobile/utils/migration.dart';
import 'package:isar/isar.dart';
import 'package:logging/logging.dart';
import 'package:path_provider/path_provider.dart';
import 'constants/hive_box.dart';
@ -72,6 +73,18 @@ Future<void> initApp() async {
// Initialize Immich Logger Service
ImmichLogger().init();
var log = Logger("ImmichErrorLogger");
FlutterError.onError = (details) {
FlutterError.presentError(details);
log.severe(details.toString(), details, details.stack);
};
PlatformDispatcher.instance.onError = (error, stack) {
log.severe(error.toString(), error, stack);
return true;
};
}
Future<Isar> loadDb() async {
@ -127,8 +140,9 @@ class ImmichAppState extends ConsumerState<ImmichApp>
ref.watch(releaseInfoProvider.notifier).checkGithubReleaseInfo();
ref.watch(notificationPermissionProvider.notifier)
.getNotificationPermission();
ref
.watch(notificationPermissionProvider.notifier)
.getNotificationPermission();
break;