mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-01-27 12:34:12 +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,
|
encryptionCipher: hiverCipher,
|
||||||
);
|
);
|
||||||
Logs().i('Open Hive database...');
|
Logs().i('Open Hive database...');
|
||||||
|
try {
|
||||||
await db.open();
|
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!');
|
Logs().i('Hive database is ready!');
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user