fix: missing types

This commit is contained in:
Rafael Saes 2024-03-05 13:53:06 -03:00
parent e8abd86d3c
commit 4308e3e123
3 changed files with 12 additions and 2 deletions

View file

@ -216,4 +216,12 @@ class CWBitcoin extends Bitcoin {
final bitcoinWallet = wallet as ElectrumWallet;
return bitcoinWallet.walletAddresses.silentAddresses;
}
bool isBitcoinReceivePageOption(ReceivePageOption option) {
return option is BitcoinReceivePageOption;
}
BitcoinAddressType getOptionToType(ReceivePageOption option) {
return (option as BitcoinReceivePageOption).toType();
}
}

View file

@ -198,8 +198,8 @@ class AddressPage extends BasePage {
}
reaction((_) => receiveOptionViewModel.selectedReceiveOption, (ReceivePageOption option) {
if (option is BitcoinReceivePageOption) {
addressListViewModel.setAddressType(option.toType());
if (bitcoin!.isBitcoinReceivePageOption(option)) {
addressListViewModel.setAddressType(bitcoin!.getOptionToType(option));
return;
}

View file

@ -149,6 +149,8 @@ abstract class Bitcoin {
BitcoinAddressType getBitcoinAddressType(ReceivePageOption option);
bool hasSelectedSilentPayments(Object wallet);
List<BitcoinReceivePageOption> getBitcoinReceivePageOptions();
bool isBitcoinReceivePageOption(ReceivePageOption option);
BitcoinAddressType getOptionToType(ReceivePageOption option);
}
""";