From b3b4d803a63f48d512f9ef08b63cc57281d755c0 Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 10 Apr 2023 08:53:47 -0600 Subject: [PATCH] mobile eth restore flow navigation bug fix --- .../edit_wallet_tokens_view.dart | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/lib/pages/add_wallet_views/add_token_view/edit_wallet_tokens_view.dart b/lib/pages/add_wallet_views/add_token_view/edit_wallet_tokens_view.dart index 936ca5405..11f05c206 100644 --- a/lib/pages/add_wallet_views/add_token_view/edit_wallet_tokens_view.dart +++ b/lib/pages/add_wallet_views/add_token_view/edit_wallet_tokens_view.dart @@ -11,6 +11,7 @@ import 'package:stackwallet/pages/add_wallet_views/add_token_view/add_custom_tok import 'package:stackwallet/pages/add_wallet_views/add_token_view/sub_widgets/add_token_list.dart'; import 'package:stackwallet/pages/add_wallet_views/add_token_view/sub_widgets/add_token_list_element.dart'; import 'package:stackwallet/pages/add_wallet_views/add_token_view/sub_widgets/add_token_text.dart'; +import 'package:stackwallet/pages/home_view/home_view.dart'; import 'package:stackwallet/pages_desktop_specific/desktop_home_view.dart'; import 'package:stackwallet/providers/global/wallets_provider.dart'; import 'package:stackwallet/services/coins/ethereum/ethereum_wallet.dart'; @@ -97,16 +98,25 @@ class _EditWalletTokensViewState extends ConsumerState { if (widget.contractsToMarkSelected == null) { Navigator.of(context).pop(42); } else { - Navigator.of(context).popUntil( - ModalRoute.withName(DesktopHomeView.routeName), - ); - unawaited( - showFloatingFlushBar( - type: FlushBarType.success, - message: "${ethWallet.walletName} tokens saved", - context: context, - ), - ); + if (isDesktop) { + Navigator.of(context).popUntil( + ModalRoute.withName(DesktopHomeView.routeName), + ); + } else { + await Navigator.of(context).pushNamedAndRemoveUntil( + HomeView.routeName, + (route) => false, + ); + } + if (mounted) { + unawaited( + showFloatingFlushBar( + type: FlushBarType.success, + message: "${ethWallet.walletName} tokens saved", + context: context, + ), + ); + } } } }