diff --git a/mobile/lib/repositories/auth.repository.dart b/mobile/lib/repositories/auth.repository.dart index f003890696bba..ababf35c9b5b3 100644 --- a/mobile/lib/repositories/auth.repository.dart +++ b/mobile/lib/repositories/auth.repository.dart @@ -17,12 +17,14 @@ class AuthRepository extends DatabaseRepository implements IAuthRepository { @override Future clearLocalData() { - return db.writeTxn(() async { - await db.assets.clear(); - await db.exifInfos.clear(); - await db.albums.clear(); - await db.eTags.clear(); - await db.users.clear(); + return db.writeTxn(() { + return Future.wait([ + db.assets.clear(), + db.exifInfos.clear(), + db.albums.clear(), + db.eTags.clear(), + db.users.clear(), + ]); }); } } diff --git a/mobile/lib/services/auth.service.dart b/mobile/lib/services/auth.service.dart index e61f4859874ac..fa6e282e63bb5 100644 --- a/mobile/lib/services/auth.service.dart +++ b/mobile/lib/services/auth.service.dart @@ -63,7 +63,9 @@ class AuthService { } catch (error, stackTrace) { _log.severe("Error logging out", error, stackTrace); } finally { - await clearLocalData(); + await clearLocalData().catchError((error, stackTrace) { + _log.severe("Error clearing local data", error, stackTrace); + }); } }