Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mobile][photos] dont run _refreshReadyPersonIds() if did not actually revoke timeline

Priyanshu Dangarea935aae3d10f
diff --git a/mobile/apps/photos/lib/services/memory_lane/memory_lane_cache_service.dart b/mobile/apps/photos/lib/services/memory_lane/memory_lane_cache_service.dart
index ed4a16d412..3e4b52caf3 100644
--- a/mobile/apps/photos/lib/services/memory_lane/memory_lane_cache_service.dart
+++ b/mobile/apps/photos/lib/services/memory_lane/memory_lane_cache_service.dart
@@ -119,16 +119,17 @@ class MemoryLaneCacheService {
});
}
- Future<void> removeTimeline(String personId) async {
+ Future<bool> removeTimeline(String personId) async {
await _ensureInitialized();
- await _lock.synchronized(() async {
+ return await _lock.synchronized(() async {
final currentCache = await _loadCacheUnsafe();
if (!currentCache.timelines.containsKey(personId)) {
- return;
+ return false;
}
final updatedCache = currentCache.copyWithoutPerson(personId);
_cache = updatedCache;
await _writeCacheUnsafe();
+ return true;
});
}
diff --git a/mobile/apps/photos/lib/services/memory_lane/memory_lane_service.dart b/mobile/apps/photos/lib/services/memory_lane/memory_lane_service.dart
index 0ae10e217d..b16fce927e 100644
--- a/mobile/apps/photos/lib/services/memory_lane/memory_lane_service.dart
+++ b/mobile/apps/photos/lib/services/memory_lane/memory_lane_service.dart
@@ -309,8 +309,10 @@ class MemoryLaneService {
Future<void> _revokeTimeline(String id) async {
_pendingRequests[id]?.isRevoked = true;
- await _cacheService.removeTimeline(id);
- await _refreshReadyPersonIds();
+ final didRemove = await _cacheService.removeTimeline(id);
+ if (didRemove) {
+ await _refreshReadyPersonIds();
+ }
}
void _handlePeopleChange(PeopleChangedEvent event) {