token loading screen navigation fix

This commit is contained in:
julian 2023-07-01 14:09:38 -06:00
parent fa1dbdbe51
commit 26bddae248

View file

@ -26,6 +26,7 @@ import 'package:stackwallet/services/ethereum/ethereum_token_service.dart';
import 'package:stackwallet/services/transaction_notification_tracker.dart'; import 'package:stackwallet/services/transaction_notification_tracker.dart';
import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/show_loading.dart'; import 'package:stackwallet/utilities/show_loading.dart';
import 'package:stackwallet/utilities/util.dart'; import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/conditional_parent.dart'; import 'package:stackwallet/widgets/conditional_parent.dart';
@ -136,17 +137,18 @@ class SimpleWalletCard extends ConsumerWidget {
context: desktopNavigatorState?.context ?? context, context: desktopNavigatorState?.context ?? context,
opaqueBG: true, opaqueBG: true,
message: "Loading ${contract.name}", message: "Loading ${contract.name}",
isDesktop: Util.isDesktop,
); );
if (!success) { if (!success) {
// TODO: show error dialog here?
Logging.instance.log(
"Failed to load token wallet for $contract",
level: LogLevel.Error,
);
return; return;
} }
if (desktopNavigatorState == null) {
// pop loading
nav.pop();
}
if (desktopNavigatorState != null) { if (desktopNavigatorState != null) {
await desktopNavigatorState!.pushNamed( await desktopNavigatorState!.pushNamed(
DesktopTokenView.routeName, DesktopTokenView.routeName,