mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 20:39:51 +00:00
TMP
This commit is contained in:
parent
04e7c18841
commit
f9cc21478a
16 changed files with 796 additions and 303 deletions
|
@ -8,22 +8,25 @@ import 'package:cake_wallet/store/authentication_store.dart';
|
|||
ReactionDisposer _onAuthenticationStateChange;
|
||||
|
||||
void startAuthenticationStateChange(AuthenticationStore authenticationStore,
|
||||
GlobalKey<NavigatorState> navigatorKey) {
|
||||
@required GlobalKey<NavigatorState> navigatorKey) {
|
||||
_onAuthenticationStateChange ??= autorun((_) async {
|
||||
final state = authenticationStore.state;
|
||||
|
||||
if (state == AuthenticationState.installed) {
|
||||
await loadCurrentWallet();
|
||||
return;
|
||||
}
|
||||
|
||||
if (state == AuthenticationState.allowed) {
|
||||
await navigatorKey.currentState
|
||||
.pushNamedAndRemoveUntil(Routes.dashboard, (route) => false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (state == AuthenticationState.denied) {
|
||||
await navigatorKey.currentState
|
||||
.pushNamedAndRemoveUntil(Routes.welcome, (_) => false);
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue