浏览代码

Merge pull request #816 from ente-io/clear_cache_on_logout

Clear the cache of upload URLs once the user logs out
Vishnu Mohandas 2 年之前
父节点
当前提交
118f29e4f6
共有 2 个文件被更改,包括 6 次插入0 次删除
  1. 2 0
      lib/core/configuration.dart
  2. 4 0
      lib/utils/file_uploader.dart

+ 2 - 0
lib/core/configuration.dart

@@ -30,6 +30,7 @@ import 'package:photos/services/memories_service.dart';
 import 'package:photos/services/search_service.dart';
 import 'package:photos/services/sync_service.dart';
 import 'package:photos/utils/crypto_util.dart';
+import 'package:photos/utils/file_uploader.dart';
 import 'package:photos/utils/validator_util.dart';
 import 'package:shared_preferences/shared_preferences.dart';
 import 'package:uuid/uuid.dart';
@@ -162,6 +163,7 @@ class Configuration {
     await UploadLocksDB.instance.clearTable();
     await IgnoredFilesService.instance.reset();
     await TrashDB.instance.clearTable();
+    FileUploader.instance.clearCachedUploadURLs();
     if (!autoLogout) {
       CollectionsService.instance.clearCache();
       FavoritesService.instance.clearCache();

+ 4 - 0
lib/utils/file_uploader.dart

@@ -176,6 +176,10 @@ class FileUploader {
     _totalCountInUploadSession = 0;
   }
 
+  void clearCachedUploadURLs() {
+    _uploadURLs.clear();
+  }
+
   void removeFromQueueWhere(final bool Function(File) fn, final Error reason) {
     final List<String> uploadsToBeRemoved = [];
     _queue.entries