Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob][photos] Move FG notification init off splash path

laurenspriem7a418cfd3bf5
diff --git a/mobile/apps/photos/lib/main.dart b/mobile/apps/photos/lib/main.dart
index c94bb43393..5e124f0ef2 100644
--- a/mobile/apps/photos/lib/main.dart
+++ b/mobile/apps/photos/lib/main.dart
@@ -255,7 +255,9 @@ Future<void> _init(bool isBackground, {String via = ''}) async {
_logger.info("_logFGHeartBeatInfo done $tlog");
unawaited(_scheduleHeartBeat(preferences, isBackground));
NotificationService.instance.init(preferences);
- await NotificationService.instance.initializeForBackground();
+ if (isBackground) {
+ await NotificationService.instance.initializeForBackground();
+ }
AppLifecycleService.instance.init(preferences);
if (isBackground) {
AppLifecycleService.instance.onAppInBackground('init via: $via $tlog');
diff --git a/mobile/apps/photos/lib/ui/tabs/home_widget.dart b/mobile/apps/photos/lib/ui/tabs/home_widget.dart
index b2566b1e70..cb4ad0d541 100644
--- a/mobile/apps/photos/lib/ui/tabs/home_widget.dart
+++ b/mobile/apps/photos/lib/ui/tabs/home_widget.dart
@@ -151,6 +151,10 @@ class _HomeWidgetState extends State<HomeWidget> {
_logger.info("Building initstate");
super.initState();
+ NotificationService.instance
+ .initialize(_onDidReceiveNotificationResponse)
+ .ignore();
+
if (LocalSyncService.instance.hasCompletedFirstImportOrBypassed()) {
syncWidget();
}
@@ -296,10 +300,6 @@ class _HomeWidgetState extends State<HomeWidget> {
),
);
- NotificationService.instance
- .initialize(_onDidReceiveNotificationResponse)
- .ignore();
-
if (Platform.isAndroid &&
!localSettings.hasConfiguredInAppLinkPermissions() &&
RemoteSyncService.instance.isFirstRemoteSyncDone() &&