From 7276cd41f0d7f2c81360f8b287ff7d08a29b233e Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 2 May 2024 09:41:57 -0600 Subject: [PATCH] frost wallet backup screen bugfix --- .../wallet_backup_view.dart | 4 +-- .../wallet_settings_view.dart | 32 ++++++++----------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_backup_views/wallet_backup_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_backup_views/wallet_backup_view.dart index fee8781ff..ab6baf455 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_backup_views/wallet_backup_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_backup_views/wallet_backup_view.dart @@ -35,12 +35,12 @@ import 'package:stackwallet/widgets/stack_dialog.dart'; class WalletBackupView extends ConsumerWidget { const WalletBackupView({ - Key? key, + super.key, required this.walletId, required this.mnemonic, this.frostWalletData, this.clipboardInterface = const ClipboardWrapper(), - }) : super(key: key); + }); static const String routeName = "/walletBackup"; diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_settings_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_settings_view.dart index 2eca78057..66dfb8c23 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_settings_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_settings_view.dart @@ -53,13 +53,13 @@ import 'package:tuple/tuple.dart'; /// [eventBus] should only be set during testing class WalletSettingsView extends ConsumerStatefulWidget { const WalletSettingsView({ - Key? key, + super.key, required this.walletId, required this.coin, required this.initialSyncStatus, required this.initialNodeStatus, this.eventBus, - }) : super(key: key); + }); static const String routeName = "/walletSettings"; @@ -267,31 +267,27 @@ class _WalletSettingsViewState extends ConsumerState { })? prevGen, })? frostWalletData; if (wallet is BitcoinFrostWallet) { - List> futures = []; - - futures.addAll( - [ - wallet.getSerializedKeys(), - wallet.getMultisigConfig(), - wallet.getSerializedKeysPrevGen(), - wallet.getMultisigConfigPrevGen(), - ], - ); + final futures = [ + wallet.getSerializedKeys(), + wallet.getMultisigConfig(), + wallet.getSerializedKeysPrevGen(), + wallet.getMultisigConfigPrevGen(), + ]; final results = await Future.wait(futures); - if (results.length == 5) { + if (results.length == 4) { frostWalletData = ( myName: wallet.frostInfo.myName, - config: results[1], - keys: results[0], + config: results[1]!, + keys: results[0]!, prevGen: results[2] == null || results[3] == null ? null : ( - config: results[3], - keys: results[2], + config: results[3]!, + keys: results[2]!, ), ); } @@ -301,7 +297,7 @@ class _WalletSettingsViewState extends ConsumerState { await wallet.getMnemonicAsWords(); } - if (mounted) { + if (context.mounted) { await Navigator.push( context, RouteGenerator.getRoute(