π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mobile][photos] Cancel birthday notifications of memories emptied by deletion
laurenspriemb6cf96066b85
diff --git a/mobile/apps/photos/lib/services/memories_cache_service.dart b/mobile/apps/photos/lib/services/memories_cache_service.dartindex 88687dd613..428d3f132f 100644--- a/mobile/apps/photos/lib/services/memories_cache_service.dart+++ b/mobile/apps/photos/lib/services/memories_cache_service.dart@@ -415,7 +415,7 @@ class MemoriesCacheService {bool cacheChanged = false;final filteredToShowMemories = <ToShowMemory>[];- final emptiedMemoryIDs = <String>[];+ final emptiedMemories = <ToShowMemory>[];for (final memory in cache.toShowMemories) {final memoryChanged = _removeDeletedFilesFromCacheMemory(memory,@@ -424,7 +424,7 @@ class MemoriesCacheService {if (_cacheMemoryHasFiles(memory)) {filteredToShowMemories.add(memory);} else {- emptiedMemoryIDs.add(memory.id);+ emptiedMemories.add(memory);}cacheChanged = cacheChanged || memoryChanged;}@@ -444,9 +444,25 @@ class MemoriesCacheService {cache,MemoriesCache.encodeToJsonString,);- for (final memoryID in emptiedMemoryIDs) {+ for (final memory in emptiedMemories) {await NotificationService.instance.clearAllScheduledNotifications(- containingPayload: memoryID,+ containingPayload: memory.id,+ logLines: false,+ );+ }+ final remainingBirthdayPersonIDs = filteredToShowMemories+ .where((memory) => memory.isBirthday ?? false)+ .map((memory) => memory.personID)+ .toSet();+ final emptiedBirthdayPersonIDs = emptiedMemories+ .where((memory) => memory.isBirthday ?? false)+ .map((memory) => memory.personID)+ .whereType<String>()+ .toSet()+ .difference(remainingBirthdayPersonIDs);+ for (final personID in emptiedBirthdayPersonIDs) {+ await NotificationService.instance.clearAllScheduledNotifications(+ containingPayload: "birthday_$personID",logLines: false,);}