Skip to content

Commit

Permalink
Reset-hive-when-error-in-open (#103)
Browse files Browse the repository at this point in the history
* fix: reset hive when error in open

* chore: bump version to 1.1.4
  • Loading branch information
2paperstar authored Sep 13, 2023
1 parent 0121c13 commit 6b9ea2d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/app/data/provider/db.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ class DbProvider {
await Hive.initFlutter();
Hive.registerAdapter(WriteStoreAdapter());
await Future.wait([
Hive.openBox(_settingBoxName),
Hive.openBox(_settingBoxName).catchError((_) async {
await Hive.deleteBoxFromDisk(_settingBoxName);
return Hive.openBox(_settingBoxName);
}),
]);
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: ziggle
description: ziggle
publish_to: 'none'
version: 1.1.3
version: 1.1.4

environment:
sdk: '>=3.1.0 <4.0.0'
Expand Down

0 comments on commit 6b9ea2d

Please sign in to comment.