Skip to content

Commit

Permalink
TF-2177 Upgrade hive database version and clear all account data
Browse files Browse the repository at this point in the history
Signed-off-by: dab246 <tdvu@linagora.com>
  • Loading branch information
dab246 committed Oct 24, 2023
1 parent d5bf162 commit 850eab5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/features/caching/caching_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ class CachingManager {
Future<void> onUpgradeCache(int oldVersion, int newVersion) async {
log('CachingManager::onUpgradeCache():oldVersion $oldVersion | newVersion: $newVersion');
await clearData();
if (oldVersion > 0 && oldVersion < newVersion && newVersion == 7) {
await clearAll();
}
await storeCacheVersion(newVersion);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/features/caching/config/cache_version.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

class CacheVersion {
static const int hiveDBVersion = 6;
static const int hiveDBVersion = 7;
}

0 comments on commit 850eab5

Please sign in to comment.