fix(mobile): freeze at splash screen when updating from 1.85 to the new version (#5012)

* fix(mobile): Cannot return to logged in screen due to name changes

* fix(mobile): Cannot return to logged in screen due to name changes

* remove deadcode

* test deprecate

* Add deprecated decorator

* revert api change
This commit is contained in:
Alex 2023-11-13 14:15:36 -06:00 committed by GitHub
parent 38983838fd
commit ac7e8bcdf4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 7 deletions

View file

@ -169,4 +169,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: 599d8aeb73728400c15364e734525722250a5382
COCOAPODS: 1.12.1
COCOAPODS: 1.11.3

View file

@ -40,12 +40,25 @@ class SplashScreenPage extends HookConsumerWidget {
log.severe(e);
}
isSuccess =
await ref.read(authenticationProvider.notifier).setSuccessLoginInfo(
accessToken: accessToken,
serverUrl: serverUrl,
offlineLogin: deviceIsOffline,
);
try {
isSuccess = await ref
.read(authenticationProvider.notifier)
.setSuccessLoginInfo(
accessToken: accessToken,
serverUrl: serverUrl,
offlineLogin: deviceIsOffline,
);
} catch (error, stackTrace) {
ref.read(authenticationProvider.notifier).logout();
log.severe(
'Cannot set success login info: $error',
error,
stackTrace,
);
context.autoPush(const LoginRoute());
}
}
// If the device is offline and there is a currentUser stored locallly