Skip to content

Commit

Permalink
pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
alextran1502 committed Nov 26, 2024
1 parent 769bff3 commit 6186cd3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
11 changes: 7 additions & 4 deletions mobile/lib/providers/auth.provider.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_udid/flutter_udid.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/entities/store.entity.dart';
Expand Down Expand Up @@ -119,9 +119,12 @@ class AuthNotifier extends StateNotifier<AuthState> {
error,
stackTrace,
);
debugPrint(
"Error getting user information from the server [CATCH ALL] $error $stackTrace",
);

if (kDebugMode) {
debugPrint(
"Error getting user information from the server [CATCH ALL] $error $stackTrace",
);
}
}

// If the user information is successfully retrieved, update the store
Expand Down
4 changes: 2 additions & 2 deletions mobile/lib/repositories/auth.repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class AuthRepository extends DatabaseRepository implements IAuthRepository {
AuthRepository(super.db);

@override
Future<void> clearLocalData() async {
await db.writeTxn(() async {
Future<void> clearLocalData() {
return db.writeTxn(() async {
await db.assets.clear();
await db.exifInfos.clear();
await db.albums.clear();
Expand Down
4 changes: 2 additions & 2 deletions mobile/lib/services/auth.service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ class AuthService {
/// - Asset ETag
///
/// All deletions are executed in parallel using [Future.wait].
Future<void> clearLocalData() async {
await Future.wait([
Future<void> clearLocalData() {
return Future.wait([
_authRepository.clearLocalData(),
Store.delete(StoreKey.currentUser),
Store.delete(StoreKey.accessToken),
Expand Down

0 comments on commit 6186cd3

Please sign in to comment.