mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
fix(mobile): user get logged out upon clicking on any thing after logging in (#1808)
* fix(mobile): user get logged out upon clicking on any thing after logging in * wip: fixing still * fix: the actual issue * Fix: avaialble album not updating UI
This commit is contained in:
parent
03d484aba2
commit
98998cccbc
11 changed files with 137 additions and 117 deletions
|
|
@ -92,20 +92,25 @@ class AuthenticationNotifier extends StateNotifier<AuthenticationState> {
|
|||
}
|
||||
|
||||
Future<bool> logout() async {
|
||||
await Future.wait([
|
||||
_apiService.authenticationApi.logout(),
|
||||
Hive.box(userInfoBox).delete(accessTokenKey),
|
||||
Store.delete(StoreKey.assetETag),
|
||||
Store.delete(StoreKey.userRemoteId),
|
||||
_assetCacheService.invalidate(),
|
||||
_albumCacheService.invalidate(),
|
||||
_sharedAlbumCacheService.invalidate(),
|
||||
Hive.box<HiveSavedLoginInfo>(hiveLoginInfoBox).delete(savedLoginInfoKey)
|
||||
]);
|
||||
try {
|
||||
await Future.wait([
|
||||
_apiService.authenticationApi.logout(),
|
||||
Hive.box(userInfoBox).delete(accessTokenKey),
|
||||
Store.delete(StoreKey.assetETag),
|
||||
Store.delete(StoreKey.userRemoteId),
|
||||
_assetCacheService.invalidate(),
|
||||
_albumCacheService.invalidate(),
|
||||
_sharedAlbumCacheService.invalidate(),
|
||||
Hive.box<HiveSavedLoginInfo>(hiveLoginInfoBox).delete(savedLoginInfoKey)
|
||||
]);
|
||||
|
||||
state = state.copyWith(isAuthenticated: false);
|
||||
state = state.copyWith(isAuthenticated: false);
|
||||
|
||||
return true;
|
||||
return true;
|
||||
} catch (e) {
|
||||
debugPrint("Error logging out $e");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
setAutoBackup(bool backupState) async {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue