diff --git a/lib/pages/send_view/frost_ms/frost_send_view.dart b/lib/pages/send_view/frost_ms/frost_send_view.dart index a5851977c..a150ac726 100644 --- a/lib/pages/send_view/frost_ms/frost_send_view.dart +++ b/lib/pages/send_view/frost_ms/frost_send_view.dart @@ -20,6 +20,7 @@ import '../../../frost_route_generator.dart'; import '../../../models/isar/models/isar_models.dart'; import '../../../providers/frost_wallet/frost_wallet_providers.dart'; import '../../../providers/providers.dart'; +import '../../../providers/wallet/public_private_balance_state_provider.dart'; import '../../../themes/coin_icon_provider.dart'; import '../../../themes/stack_colors.dart'; import '../../../utilities/amount/amount.dart'; @@ -234,7 +235,10 @@ class _FrostSendViewState extends ConsumerState { prefsChangeNotifierProvider.select( (value) => value.enableCoinControl, ), - ); + ) && + (coin is Firo + ? ref.watch(publicPrivateBalanceStateProvider) == FiroType.public + : true); return ConditionalParent( condition: !Util.isDesktop, diff --git a/lib/pages/send_view/send_view.dart b/lib/pages/send_view/send_view.dart index 623962845..8d1f12c5d 100644 --- a/lib/pages/send_view/send_view.dart +++ b/lib/pages/send_view/send_view.dart @@ -998,10 +998,15 @@ class _SendViewState extends ConsumerState { prefsChangeNotifierProvider.select( (value) => value.enableCoinControl, ), - ); + ) && + (coin is Firo + ? ref.watch(publicPrivateBalanceStateProvider) == FiroType.public + : true); if (isFiro) { ref.listen(publicPrivateBalanceStateProvider, (previous, next) { + selectedUTXOs = {}; + if (ref.read(pSendAmount) == null) { setState(() { _calculateFeesFuture = calculateFees( diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send.dart index 43f5eb557..6c7c28296 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send.dart @@ -17,16 +17,13 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; + import '../../../../models/isar/models/contact_entry.dart'; import '../../../../models/paynym/paynym_account_lite.dart'; import '../../../../models/send_view_auto_fill_data.dart'; import '../../../../pages/send_view/confirm_transaction_view.dart'; import '../../../../pages/send_view/sub_widgets/building_transaction_dialog.dart'; import '../../../../pages/send_view/sub_widgets/transaction_fee_selection_sheet.dart'; -import '../../../coin_control/desktop_coin_control_use_dialog.dart'; -import '../../../desktop_home_view.dart'; -import 'address_book_address_chooser/address_book_address_chooser.dart'; -import 'desktop_fee_dropdown.dart'; import '../../../../providers/providers.dart'; import '../../../../providers/ui/fee_rate_type_state_provider.dart'; import '../../../../providers/ui/preview_tx_button_state_provider.dart'; @@ -70,6 +67,10 @@ import '../../../../widgets/icon_widgets/x_icon.dart'; import '../../../../widgets/rounded_container.dart'; import '../../../../widgets/stack_text_field.dart'; import '../../../../widgets/textfield_icon_button.dart'; +import '../../../coin_control/desktop_coin_control_use_dialog.dart'; +import '../../../desktop_home_view.dart'; +import 'address_book_address_chooser/address_book_address_chooser.dart'; +import 'desktop_fee_dropdown.dart'; class DesktopSend extends ConsumerStatefulWidget { const DesktopSend({ @@ -947,7 +948,10 @@ class _DesktopSendState extends ConsumerState { (value) => value.enableCoinControl, ), ) && - ref.watch(pWallets).getWallet(walletId) is CoinControlInterface; + ref.watch(pWallets).getWallet(walletId) is CoinControlInterface && + (coin is Firo + ? ref.watch(publicPrivateBalanceStateProvider) == FiroType.public + : true); return Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -1042,6 +1046,9 @@ class _DesktopSendState extends ConsumerState { ], onChanged: (value) { if (value is FiroType) { + if (value != FiroType.public) { + ref.read(desktopUseUTXOs.state).state = {}; + } setState(() { ref.read(publicPrivateBalanceStateProvider.state).state = value; diff --git a/lib/wallets/wallet/impl/firo_wallet.dart b/lib/wallets/wallet/impl/firo_wallet.dart index 3372e11bd..9359043be 100644 --- a/lib/wallets/wallet/impl/firo_wallet.dart +++ b/lib/wallets/wallet/impl/firo_wallet.dart @@ -21,6 +21,7 @@ import '../../isar/models/spark_coin.dart'; import '../../isar/models/wallet_info.dart'; import '../../models/tx_data.dart'; import '../intermediate/bip39_hd_wallet.dart'; +import '../wallet_mixin_interfaces/coin_control_interface.dart'; import '../wallet_mixin_interfaces/electrumx_interface.dart'; import '../wallet_mixin_interfaces/lelantus_interface.dart'; import '../wallet_mixin_interfaces/spark_interface.dart'; @@ -28,7 +29,11 @@ import '../wallet_mixin_interfaces/spark_interface.dart'; const sparkStartBlock = 819300; // (approx 18 Jan 2024) class FiroWallet extends Bip39HDWallet - with ElectrumXInterface, LelantusInterface, SparkInterface { + with + ElectrumXInterface, + LelantusInterface, + SparkInterface, + CoinControlInterface { // IMPORTANT: The order of the above mixins matters. // SparkInterface MUST come after LelantusInterface.