fix: Correctly clear database if it is corrupted

This commit is contained in:
Krille Fear 2021-09-14 14:55:27 +02:00
parent 5d218fb2e4
commit cbb40b6fdb

View File

@ -91,7 +91,7 @@ class FlutterMatrixHiveStore extends FamedlySdkHiveDatabase {
await db.open(); await db.open();
} catch (e, s) { } catch (e, s) {
Logs().e('Unable to open Hive. Delete and try again...', e, s); Logs().e('Unable to open Hive. Delete and try again...', e, s);
await Hive.deleteFromDisk(); await db.clear(client.id);
await db.open(); await db.open();
} }
Logs().i('Hive database is ready!'); Logs().i('Hive database is ready!');