Skip to content

armgit / ente

Public Imported from GitHub
0

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

fix: combine functions

Prateek Sunal5541198967a8
diff --git a/mobile/apps/photos/lib/services/home_widget_service.dart b/mobile/apps/photos/lib/services/home_widget_service.dart
index c0b41da862..b5203cecc4 100644
--- a/mobile/apps/photos/lib/services/home_widget_service.dart
+++ b/mobile/apps/photos/lib/services/home_widget_service.dart
@@ -59,18 +59,18 @@ class HomeWidgetService {
bool _isAppGroupSet = false;
- Future<void> setAppGroup() async {
- if (_isAppGroupSet) return;
+ Future<void> setAppGroup({String id = iOSGroupIDMemory}) async {
+ if (!Platform.isIOS || _isAppGroupSet) return;
_logger.info("Setting app group id");
- await setAppGroupID(iOSGroupIDMemory);
+ await hw.HomeWidget.setAppGroupId(id).catchError(
+ (error) {
+ _logger.severe("Failed to set app group ID: $error");
+ return null;
+ },
+ );
_isAppGroupSet = true;
}
- Future<void> setAppGroupID(String id) async {
- if (!Platform.isIOS) return;
- await hw.HomeWidget.setAppGroupId(id);
- }
-
Future<void> initHomeWidget([bool isBg = false]) async {
await setAppGroup();
await AlbumHomeWidgetService.instance.initAlbumHomeWidget(isBg);