From b4c96a09fb169f5a1aeb5f6c2fe96b844c08c28b Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 26 Nov 2024 13:36:12 -0600 Subject: [PATCH] chore: follow up on auth refactoring (#14367) * chore: follow up on auth refactoring * remove async --- mobile/lib/repositories/auth.repository.dart | 14 ++++++++------ mobile/lib/services/auth.service.dart | 4 +++- 2 files changed, 11 insertions(+), 7 deletions(-) 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); + }); } }