diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/wallet_settings_wallet_settings_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/wallet_settings_wallet_settings_view.dart index db6aa1a5d..bf41d6261 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/wallet_settings_wallet_settings_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/wallet_settings_wallet_settings_view.dart @@ -282,11 +282,11 @@ class _WalletSettingsWalletSettingsViewState ), ), ), - if (wallet is LelantusInterface) + if (wallet is LelantusInterface && !wallet.isViewOnly) const SizedBox( height: 8, ), - if (wallet is LelantusInterface) + if (wallet is LelantusInterface && !wallet.isViewOnly) RoundedWhiteContainer( padding: const EdgeInsets.all(0), child: RawMaterialButton( @@ -318,11 +318,11 @@ class _WalletSettingsWalletSettingsViewState ), ), ), - if (wallet is SparkInterface) + if (wallet is SparkInterface && !wallet.isViewOnly) const SizedBox( height: 8, ), - if (wallet is SparkInterface) + if (wallet is SparkInterface && !wallet.isViewOnly) RoundedWhiteContainer( padding: const EdgeInsets.all(0), child: RawMaterialButton( @@ -369,7 +369,7 @@ class _WalletSettingsWalletSettingsViewState materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, padding: const EdgeInsets.all(0), onPressed: () { - showDialog( + showDialog( barrierDismissible: true, context: context, builder: (_) => StackDialog( diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_wallet_features.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_wallet_features.dart index 470c1f89b..9ad37d2a7 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_wallet_features.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_wallet_features.dart @@ -207,7 +207,7 @@ class _DesktopWalletFeaturesState extends ConsumerState { // await firoWallet.anonymizeAllLelantus(); await firoWallet.anonymizeAllSpark(); shouldPop = true; - if (context.mounted) { + if (mounted) { Navigator.of(context, rootNavigator: true).pop(); Navigator.of(context).popUntil( ModalRoute.withName(DesktopWalletView.routeName), @@ -222,7 +222,7 @@ class _DesktopWalletFeaturesState extends ConsumerState { } } catch (e) { shouldPop = true; - if (context.mounted) { + if (mounted) { Navigator.of(context, rootNavigator: true).pop(); Navigator.of(context).popUntil( ModalRoute.withName(DesktopWalletView.routeName), diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/more_features/more_features_dialog.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/more_features/more_features_dialog.dart index 97b77ec2e..3d9c6b183 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/more_features/more_features_dialog.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/more_features/more_features_dialog.dart @@ -321,11 +321,11 @@ class _MoreFeaturesDialogState extends ConsumerState { iconAsset: Assets.svg.churn, onPressed: () async => widget.onChurnPressed?.call(), ), - if (wallet is SparkInterface) + if (wallet is SparkInterface && !isViewOnly) _MoreFeaturesClearSparkCacheItem( cryptoCurrency: wallet.cryptoCurrency, ), - if (wallet is LelantusInterface) + if (wallet is LelantusInterface && !isViewOnly) _MoreFeaturesItemBase( child: Row( children: [ diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/wallet_options_button.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/wallet_options_button.dart index e0ece604c..e0da6d5e9 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/wallet_options_button.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/wallet_options_button.dart @@ -294,13 +294,14 @@ class WalletOptionsPopupMenu extends ConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { final coin = ref.watch(pWalletCoin(walletId)); - final firoDebug = kDebugMode && (coin is Firo); + bool firoDebug = kDebugMode && (coin is Firo); final wallet = ref.watch(pWallets).getWallet(walletId); bool xpubEnabled = wallet is ExtendedKeysInterface; if (wallet is ViewOnlyOptionInterface && wallet.isViewOnly) { xpubEnabled = false; + firoDebug = false; } final bool canChangeRep = coin is NanoCurrency; diff --git a/lib/wallets/wallet/impl/firo_wallet.dart b/lib/wallets/wallet/impl/firo_wallet.dart index f9fcb11b5..f68a83917 100644 --- a/lib/wallets/wallet/impl/firo_wallet.dart +++ b/lib/wallets/wallet/impl/firo_wallet.dart @@ -659,6 +659,11 @@ class FiroWallet extends Bip39HDWallet @override Future recover({required bool isRescan}) async { + if (isViewOnly) { + await recoverViewOnly(isRescan: isRescan); + return; + } + // reset last checked values await info.updateOtherData( newEntries: { diff --git a/lib/wallets/wallet/wallet.dart b/lib/wallets/wallet/wallet.dart index 6eea07a92..0beaf2a80 100644 --- a/lib/wallets/wallet/wallet.dart +++ b/lib/wallets/wallet/wallet.dart @@ -665,7 +665,7 @@ abstract class Wallet { } _checkAlive(); GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.3, walletId)); - if (this is SparkInterface) { + if (this is SparkInterface && !viewOnly) { // this should be called before updateTransactions() await (this as SparkInterface).refreshSparkData(); } @@ -702,7 +702,7 @@ abstract class Wallet { _checkAlive(); // TODO: [prio=low] handle this differently. Extra modification of this file for coin specific functionality should be avoided. - if (this is LelantusInterface) { + if (this is LelantusInterface && !viewOnly) { if (info.otherData[WalletInfoKeys.enableLelantusScanning] as bool? ?? false) { await (this as LelantusInterface).refreshLelantusData();