mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-01-11 18:22:49 +01:00
change: Delete hive database if corrupted
This commit is contained in:
parent
1f57ee110f
commit
caae0ccd01
@ -87,7 +87,13 @@ class FlutterMatrixHiveStore extends FamedlySdkHiveDatabase {
|
||||
encryptionCipher: hiverCipher,
|
||||
);
|
||||
Logs().i('Open Hive database...');
|
||||
await db.open();
|
||||
try {
|
||||
await db.open();
|
||||
} catch (e, s) {
|
||||
Logs().e('Unable to open Hive. Delete and try again...', e, s);
|
||||
await Hive.deleteFromDisk();
|
||||
await db.open();
|
||||
}
|
||||
Logs().i('Hive database is ready!');
|
||||
return db;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user