From 4b5386236acdccea7f882463828239a298885e1f Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 13 Feb 2023 13:26:29 -0600 Subject: [PATCH] xmr/wow loading fix when opened from fav card --- .../sub_widgets/favorite_card.dart | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/lib/pages/wallets_view/sub_widgets/favorite_card.dart b/lib/pages/wallets_view/sub_widgets/favorite_card.dart index fa0f0c490..318f8e301 100644 --- a/lib/pages/wallets_view/sub_widgets/favorite_card.dart +++ b/lib/pages/wallets_view/sub_widgets/favorite_card.dart @@ -105,20 +105,25 @@ class _FavoriteCardState extends ConsumerState { ), ), child: GestureDetector( - onTap: () { - if (Util.isDesktop) { - Navigator.of(context).pushNamed( - DesktopWalletView.routeName, - arguments: walletId, - ); - } else { - Navigator.of(context).pushNamed( - WalletView.routeName, - arguments: Tuple2( - walletId, - managerProvider, - ), - ); + onTap: () async { + if (coin == Coin.monero || coin == Coin.wownero) { + await ref.read(managerProvider).initializeExisting(); + } + if (mounted) { + if (Util.isDesktop) { + await Navigator.of(context).pushNamed( + DesktopWalletView.routeName, + arguments: walletId, + ); + } else { + await Navigator.of(context).pushNamed( + WalletView.routeName, + arguments: Tuple2( + walletId, + managerProvider, + ), + ); + } } }, child: SizedBox(