From 2d2cfb03498252e0e5062f422cb73284fbab3b5f Mon Sep 17 00:00:00 2001 From: martyfuhry Date: Mon, 20 Feb 2023 22:44:14 -0500 Subject: [PATCH] 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 --- .../backup/background_service/background.service.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mobile/lib/modules/backup/background_service/background.service.dart b/mobile/lib/modules/backup/background_service/background.service.dart index 6f8cad790e..7009414e6c 100644 --- a/mobile/lib/modules/backup/background_service/background.service.dart +++ b/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) {