Forráskód Böngészése

fix(mobiile): Fixed load translations in background sync (#1810)

* fixed regression where i accidentally removed load translations from the background sync

* only for android

---------

Co-authored-by: Marty Fuhry <marty@fuhry.farm>
martyfuhry 2 éve
szülő
commit
2d2cfb0349

+ 8 - 0
mobile/lib/modules/backup/background_service/background.service.dart

@@ -10,6 +10,7 @@ import 'package:flutter/widgets.dart';
 import 'package:hive_flutter/hive_flutter.dart';
 import 'package:hooks_riverpod/hooks_riverpod.dart';
 import 'package:immich_mobile/constants/hive_box.dart';
+import 'package:immich_mobile/modules/backup/background_service/localization.dart';
 import 'package:immich_mobile/modules/backup/models/current_upload_asset.model.dart';
 import 'package:immich_mobile/modules/backup/models/error_upload_asset.model.dart';
 import 'package:immich_mobile/modules/backup/models/hive_backup_albums.model.dart';
@@ -312,6 +313,13 @@ class BackgroundService {
             debugPrint("[_callHandler] could not acquire lock, exiting");
             return false;
           }
+
+          // Notifications aren't enabled in iOS yet, and this line
+          // below crashes the iOS background service
+          if (Platform.isAndroid) {
+            await loadTranslations();
+          }
+
           final bool ok = await _onAssetsChanged();
           return ok;
         } catch (error) {