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:
Alex
2023-02-20 21:43:39 -06:00
committed by GitHub
parent 03d484aba2
commit 98998cccbc
11 changed files with 137 additions and 117 deletions

View File

@@ -298,10 +298,10 @@ class LoginButton extends ConsumerWidget {
),
onPressed: () async {
// This will remove current cache asset state of previous user login.
ref.watch(assetProvider.notifier).clearAllAsset();
ref.read(assetProvider.notifier).clearAllAsset();
var isAuthenticated =
await ref.watch(authenticationProvider.notifier).login(
await ref.read(authenticationProvider.notifier).login(
emailController.text,
passwordController.text,
serverEndpointController.text,
@@ -309,12 +309,11 @@ class LoginButton extends ConsumerWidget {
if (isAuthenticated) {
// Resume backup (if enable) then navigate
if (ref.watch(authenticationProvider).shouldChangePassword &&
!ref.watch(authenticationProvider).isAdmin) {
if (ref.read(authenticationProvider).shouldChangePassword &&
!ref.read(authenticationProvider).isAdmin) {
AutoRouter.of(context).push(const ChangePasswordRoute());
} else {
ref.watch(backupProvider.notifier).resumeBackup();
ref.read(backupProvider.notifier).resumeBackup();
AutoRouter.of(context).replace(const TabControllerRoute());
}
} else {