Skip to content

Commit

Permalink
chore: follow up on auth refactoring (#14367)
Browse files Browse the repository at this point in the history
* chore: follow up on auth refactoring

* remove async
  • Loading branch information
alextran1502 authored Nov 26, 2024
1 parent 21f14be commit b4c96a0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 8 additions & 6 deletions mobile/lib/repositories/auth.repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ class AuthRepository extends DatabaseRepository implements IAuthRepository {

@override
Future<void> 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(),
]);
});
}
}
4 changes: 3 additions & 1 deletion mobile/lib/services/auth.service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
}

Expand Down

0 comments on commit b4c96a0

Please sign in to comment.