mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00:00
fix(ui): remove SP from UI in view only wallet
This commit is contained in:
parent
da1e467f0a
commit
7fba63712d
5 changed files with 18 additions and 11 deletions
|
@ -28,6 +28,14 @@ class BitcoinReceivePageOption implements ReceivePageOption {
|
|||
BitcoinReceivePageOption.p2pkh
|
||||
];
|
||||
|
||||
static const allViewOnly = [
|
||||
BitcoinReceivePageOption.p2wpkh,
|
||||
BitcoinReceivePageOption.p2tr,
|
||||
BitcoinReceivePageOption.p2wsh,
|
||||
BitcoinReceivePageOption.p2sh,
|
||||
BitcoinReceivePageOption.p2pkh
|
||||
];
|
||||
|
||||
static const allLitecoin = [
|
||||
BitcoinReceivePageOption.p2wpkh,
|
||||
BitcoinReceivePageOption.mweb,
|
||||
|
|
|
@ -1110,14 +1110,6 @@ packages:
|
|||
url: "https://github.com/bukata-sa/bc-ur-dart"
|
||||
source: git
|
||||
version: "0.1.0"
|
||||
uuid:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: uuid
|
||||
sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.5.1"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
@ -280,7 +280,14 @@ class CWBitcoin extends Bitcoin {
|
|||
}
|
||||
|
||||
@override
|
||||
List<ReceivePageOption> getBitcoinReceivePageOptions() => BitcoinReceivePageOption.all;
|
||||
List<ReceivePageOption> getBitcoinReceivePageOptions(Object wallet) {
|
||||
final bitcoinWallet = wallet as ElectrumWallet;
|
||||
final keys = bitcoinWallet.keys;
|
||||
if (keys.privateKey.isEmpty) {
|
||||
return BitcoinReceivePageOption.allViewOnly;
|
||||
}
|
||||
return BitcoinReceivePageOption.all;
|
||||
}
|
||||
|
||||
@override
|
||||
List<ReceivePageOption> getLitecoinReceivePageOptions() {
|
||||
|
|
|
@ -22,7 +22,7 @@ abstract class ReceiveOptionViewModelBase with Store {
|
|||
switch (walletType) {
|
||||
case WalletType.bitcoin:
|
||||
_options = [
|
||||
...bitcoin!.getBitcoinReceivePageOptions(),
|
||||
...bitcoin!.getBitcoinReceivePageOptions(_wallet),
|
||||
...ReceivePageOptions.where((element) => element != ReceivePageOption.mainnet)
|
||||
];
|
||||
break;
|
||||
|
|
|
@ -207,7 +207,7 @@ abstract class Bitcoin {
|
|||
Map<DerivationType, List<DerivationInfo>> getElectrumDerivations();
|
||||
Future<void> setAddressType(Object wallet, dynamic option);
|
||||
ReceivePageOption getSelectedAddressType(Object wallet);
|
||||
List<ReceivePageOption> getBitcoinReceivePageOptions();
|
||||
List<ReceivePageOption> getBitcoinReceivePageOptions(Object wallet);
|
||||
List<ReceivePageOption> getLitecoinReceivePageOptions();
|
||||
BitcoinAddressType getBitcoinAddressType(ReceivePageOption option);
|
||||
bool isPayjoinAvailable(Object wallet);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue