From 93f6dd4ceeb120407a97ad727997bec327de1856 Mon Sep 17 00:00:00 2001 From: Matthew Fosse Date: Wed, 24 Jul 2024 12:02:04 -0500 Subject: [PATCH] fix for building monero.com --- lib/bitcoin/cw_bitcoin.dart | 3 +++ lib/view_model/dashboard/receive_option_view_model.dart | 6 +++--- tool/configure.dart | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/bitcoin/cw_bitcoin.dart b/lib/bitcoin/cw_bitcoin.dart index 210120ba0..0d7d3a1f2 100644 --- a/lib/bitcoin/cw_bitcoin.dart +++ b/lib/bitcoin/cw_bitcoin.dart @@ -248,6 +248,9 @@ class CWBitcoin extends Bitcoin { @override List getBitcoinReceivePageOptions() => BitcoinReceivePageOption.all; + @override + List getLitecoinReceivePageOptions() => BitcoinReceivePageOption.allLitecoin; + @override BitcoinAddressType getBitcoinAddressType(ReceivePageOption option) { switch (option) { diff --git a/lib/view_model/dashboard/receive_option_view_model.dart b/lib/view_model/dashboard/receive_option_view_model.dart index 472918f4a..b9c8c5fc6 100644 --- a/lib/view_model/dashboard/receive_option_view_model.dart +++ b/lib/view_model/dashboard/receive_option_view_model.dart @@ -1,5 +1,4 @@ import 'package:cake_wallet/bitcoin/bitcoin.dart'; -import 'package:cw_bitcoin/bitcoin_receive_page_option.dart'; import 'package:cw_core/receive_page_option.dart'; import 'package:cw_core/wallet_base.dart'; import 'package:cw_core/wallet_type.dart'; @@ -17,7 +16,8 @@ abstract class ReceiveOptionViewModelBase with Store { ? bitcoin!.getSelectedAddressType(_wallet) : ReceivePageOption.mainnet), _options = [] { - switch (_wallet.type) { + final walletType = _wallet.type; + switch (walletType) { case WalletType.bitcoin: _options = [ ...bitcoin!.getBitcoinReceivePageOptions(), @@ -26,7 +26,7 @@ abstract class ReceiveOptionViewModelBase with Store { break; case WalletType.litecoin: _options = [ - ...BitcoinReceivePageOption.allLitecoin, + ...bitcoin!.getLitecoinReceivePageOptions() ...ReceivePageOptions.where((element) => element != ReceivePageOption.mainnet) ]; break; diff --git a/tool/configure.dart b/tool/configure.dart index 021113125..58b0971c4 100644 --- a/tool/configure.dart +++ b/tool/configure.dart @@ -196,6 +196,7 @@ abstract class Bitcoin { Future setAddressType(Object wallet, dynamic option); ReceivePageOption getSelectedAddressType(Object wallet); List getBitcoinReceivePageOptions(); + List getLitecoinReceivePageOptions(); BitcoinAddressType getBitcoinAddressType(ReceivePageOption option); bool hasSelectedSilentPayments(Object wallet); bool isBitcoinReceivePageOption(ReceivePageOption option);