Skip to content

armgit / ente

Public Imported from GitHub
0

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

Merge branch 'main' into birthday_notification

laurenspriem07d7635464c0
diff --cc mobile/lib/services/memories_cache_service.dart
index 82c828696d,17fd486f33..839a53cead
--- a/mobile/lib/services/memories_cache_service.dart
+++ b/mobile/lib/services/memories_cache_service.dart
@@@ -244,13 -255,12 +256,19 @@@ class MemoriesCacheService
return newCache;
}
+ Future<void> _clearAllScheduledOnThisDayNotifications() async {
+ _logger.info('Clearing all scheduled On This Day notifications');
+ await NotificationService.instance
+ .clearAllScheduledNotifications(containingPayload: "onThisDay");
+ }
+
+ Future<void> _scheduleMemoryNotifications(
+ List<SmartMemory> allMemories,
+ ) async {
+ await _scheduleOnThisDayNotifications(allMemories);
+ await _scheduleBirthdayNotifications(allMemories);
+ }
+
Future<void> _scheduleOnThisDayNotifications(
List<SmartMemory> allMemories,
) async {
diff --cc mobile/lib/ui/tabs/home_widget.dart
index 46c6c0d6b0,7414637e70..0b2ffa26ab
--- a/mobile/lib/ui/tabs/home_widget.dart
+++ b/mobile/lib/ui/tabs/home_widget.dart
@@@ -857,12 -863,8 +863,9 @@@ class _HomeWidgetState extends State<Ho
debugPrint('notification payload: $payload');
if (payload.toLowerCase().contains("onthisday")) {
// ignore: unawaited_futures
- memoriesCacheService.goToMemoryFromMemoryID(
- context,
- payload,
- );
+ memoriesCacheService.goToOnThisDayMemory(context);
} else {
+ // TODO:lau (after mergin main): add another case here for birthday notifications
final collectionID = Uri.parse(payload).queryParameters["collectionID"];
if (collectionID != null) {
final collection = CollectionsService.instance