Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: follow up on auth refactoring #14367

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading