diff --git a/lib/data/hive/hive_collection_tom_database.dart b/lib/data/hive/hive_collection_tom_database.dart index c66504e431..fd304a4cd4 100644 --- a/lib/data/hive/hive_collection_tom_database.dart +++ b/lib/data/hive/hive_collection_tom_database.dart @@ -124,6 +124,7 @@ class HiveCollectionToMDatabase { await const FlutterSecureStorage() .delete(key: FlutterHiveCollectionsDatabase.cipherStorageKey); await tomConfigurationsBox.clear(); + await _collection.deleteFromDisk(); await Hive.deleteFromDisk(); } } diff --git a/lib/widgets/matrix.dart b/lib/widgets/matrix.dart index cce66c54d6..4347bddb0a 100644 --- a/lib/widgets/matrix.dart +++ b/lib/widgets/matrix.dart @@ -355,8 +355,8 @@ class MatrixState extends State with WidgetsBindingObserver { navigatorContext?.go('/rooms'); } else { - setUpToMServicesInLogin(c); if (state == LoginState.loggedIn) { + await setUpToMServicesInLogin(c); navigatorContext?.go('/rooms'); } else { await getIt.get().clear(); @@ -488,7 +488,8 @@ class MatrixState extends State with WidgetsBindingObserver { } } - void setUpToMServicesInLogin(Client client) { + Future setUpToMServicesInLogin(Client client) async { + await HiveCollectionToMDatabase.databaseBuilder(); final tomServer = loginHomeserverSummary?.tomServer; if (tomServer != null) { _setUpToMServer(tomServer);