fix(mobile) - Allow sign out if server is down, or device is offline (#3275)

* WIP: Allow app sign out when server cannot be reached

* WIP: import logging lib

* WIP: move log out up
This commit is contained in:
Dhrumil Shah
2023-07-15 21:52:41 -04:00
committed by GitHub
parent 7595d01956
commit 9012cf6946
3 changed files with 25 additions and 21 deletions

View File

@@ -33,14 +33,12 @@ class ProfileDrawer extends HookConsumerWidget {
?.copyWith(fontWeight: FontWeight.bold),
).tr(),
onTap: () async {
bool res = await ref.watch(authenticationProvider.notifier).logout();
await ref.watch(authenticationProvider.notifier).logout();
if (res) {
ref.watch(backupProvider.notifier).cancelBackup();
ref.watch(assetProvider.notifier).clearAllAsset();
ref.watch(websocketProvider.notifier).disconnect();
AutoRouter.of(context).replace(const LoginRoute());
}
ref.watch(backupProvider.notifier).cancelBackup();
ref.watch(assetProvider.notifier).clearAllAsset();
ref.watch(websocketProvider.notifier).disconnect();
AutoRouter.of(context).replace(const LoginRoute());
},
);
}