mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-23 11:04:33 +00:00
refresh eth wallets list on adding new (restored) token wallet
This commit is contained in:
parent
9ad0343d63
commit
5ce5ae3f4d
2 changed files with 57 additions and 23 deletions
|
@ -16,6 +16,8 @@ import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/confirm_r
|
|||
import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/sub_widgets/restore_failed_dialog.dart';
|
||||
import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/sub_widgets/restore_succeeded_dialog.dart';
|
||||
import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/sub_widgets/restoring_dialog.dart';
|
||||
import 'package:stackwallet/pages/add_wallet_views/select_wallet_for_token_view.dart';
|
||||
import 'package:stackwallet/pages/add_wallet_views/verify_recovery_phrase_view/verify_recovery_phrase_view.dart';
|
||||
import 'package:stackwallet/pages/home_view/home_view.dart';
|
||||
import 'package:stackwallet/pages_desktop_specific/desktop_home_view.dart';
|
||||
import 'package:stackwallet/pages_desktop_specific/my_stack_view/exit_to_my_stack_button.dart';
|
||||
|
@ -310,24 +312,54 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
|
|||
.read(walletsChangeNotifierProvider.notifier)
|
||||
.addWallet(walletId: manager.walletId, manager: manager);
|
||||
|
||||
if (mounted) {
|
||||
if (isDesktop) {
|
||||
Navigator.of(context)
|
||||
.popUntil(ModalRoute.withName(DesktopHomeView.routeName));
|
||||
} else {
|
||||
unawaited(Navigator.of(context).pushNamedAndRemoveUntil(
|
||||
HomeView.routeName, (route) => false));
|
||||
}
|
||||
final isCreateSpecialEthWallet =
|
||||
ref.read(createSpecialEthWalletRoutingFlag);
|
||||
if (isCreateSpecialEthWallet) {
|
||||
ref.read(createSpecialEthWalletRoutingFlag.notifier).state =
|
||||
false;
|
||||
ref
|
||||
.read(newEthWalletTriggerTempUntilHiveCompletelyDeleted.state)
|
||||
.state =
|
||||
!ref
|
||||
.read(newEthWalletTriggerTempUntilHiveCompletelyDeleted
|
||||
.state)
|
||||
.state;
|
||||
}
|
||||
|
||||
if (mounted) {
|
||||
if (isDesktop) {
|
||||
Navigator.of(context).popUntil(
|
||||
ModalRoute.withName(
|
||||
DesktopHomeView.routeName,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
if (isCreateSpecialEthWallet) {
|
||||
Navigator.of(context).popUntil(
|
||||
ModalRoute.withName(
|
||||
SelectWalletForTokenView.routeName,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
unawaited(
|
||||
Navigator.of(context).pushNamedAndRemoveUntil(
|
||||
HomeView.routeName,
|
||||
(route) => false,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
await showDialog<dynamic>(
|
||||
context: context,
|
||||
useSafeArea: false,
|
||||
barrierDismissible: true,
|
||||
builder: (context) {
|
||||
return const RestoreSucceededDialog();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
await showDialog<dynamic>(
|
||||
context: context,
|
||||
useSafeArea: false,
|
||||
barrierDismissible: true,
|
||||
builder: (context) {
|
||||
return const RestoreSucceededDialog();
|
||||
},
|
||||
);
|
||||
if (!Platform.isLinux && !isDesktop) {
|
||||
await Wakelock.disable();
|
||||
}
|
||||
|
|
|
@ -141,14 +141,16 @@ class _VerifyRecoveryPhraseViewState
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unawaited(showFloatingFlushBar(
|
||||
type: FlushBarType.success,
|
||||
message: "Correct! Your wallet is set up.",
|
||||
iconAsset: Assets.svg.check,
|
||||
context: context,
|
||||
));
|
||||
unawaited(
|
||||
showFloatingFlushBar(
|
||||
type: FlushBarType.success,
|
||||
message: "Correct! Your wallet is set up.",
|
||||
iconAsset: Assets.svg.check,
|
||||
context: context,
|
||||
),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
unawaited(showFloatingFlushBar(
|
||||
type: FlushBarType.warning,
|
||||
|
|
Loading…
Reference in a new issue