Skip to content

Commit 7533b51

Browse files
committed
restore whenError in local storage
1 parent 3e8ab1e commit 7533b51

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/src/storage/local_storage.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ class LocalStorage {
6161
''');
6262
} catch (e, stackTrace) {
6363
print('[flutter_data] Failed to open:\n$e\n$stackTrace');
64+
if (clear == LocalStorageClearStrategy.whenError) {
65+
dispose();
66+
await destroy();
67+
await initialize();
68+
}
6469
}
6570

6671
isInitialized = true;

0 commit comments

Comments
 (0)