Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Clear memory share cache on logout

AmanRajSinghMourya03b00a45ff32
diff --git a/mobile/apps/photos/lib/core/configuration.dart b/mobile/apps/photos/lib/core/configuration.dart
index ad8edb6ae7..1014e1eff0 100644
--- a/mobile/apps/photos/lib/core/configuration.dart
+++ b/mobile/apps/photos/lib/core/configuration.dart
@@ -38,6 +38,7 @@ import "package:photos/services/home_widget_service.dart";
import 'package:photos/services/ignored_files_service.dart';
import "package:photos/services/machine_learning/face_ml/person/person_service.dart";
import "package:photos/services/machine_learning/similar_images_service.dart";
+import "package:photos/services/memory_share_service.dart";
import "package:photos/services/notification_service.dart";
import 'package:photos/services/search_service.dart';
import 'package:photos/services/sync/sync_service.dart';
@@ -255,6 +256,7 @@ class Configuration {
await SimilarImagesService.instance.clearCache();
await IgnoredFilesService.instance.reset();
unawaited(HomeWidgetService.instance.clearWidget(autoLogout));
+ MemoryShareService.instance.clearCache();
// Clear additional caches (safe to call even if not initialized)
try {
diff --git a/mobile/apps/photos/lib/services/memory_share_service.dart b/mobile/apps/photos/lib/services/memory_share_service.dart
index e12d9f1f68..6f11b9fccb 100644
--- a/mobile/apps/photos/lib/services/memory_share_service.dart
+++ b/mobile/apps/photos/lib/services/memory_share_service.dart
@@ -38,6 +38,10 @@ class MemoryShareService {
await _loadMemoryShareHashCache();
}
+ void clearCache() {
+ _memoryShareByHashCache.clear();
+ }
+
Future<(String, int)> _createMemoryLink({
required List<EnteFile> files,
required String title,