Keep Enable Lightning toggle visible after disabling it (#3702)

This commit is contained in:
claude[bot]
2026-10-09 12:28:47 +02:00
committed by GitHub
parent 37ef179f6e
commit 8b05da8e86
2 changed files with 5 additions and 3 deletions
+4 -2
View File
@@ -160,9 +160,11 @@ abstract class BitcoinWalletBase extends ElectrumWallet with Store {
lnurlDomain: "cake.cash",
cachedAddress: cachedLightningAddress,
);
walletAddresses.lightningWallet = lightningWallet;
walletAddresses.setLightningAddress(walletInfo.name);
}
} else {
lightningWallet?.close();
lightningWallet = null;
}
});
@@ -426,7 +428,7 @@ abstract class BitcoinWalletBase extends ElectrumWallet with Store {
bool get hasPayjoinSupport => keys.privateKey.isNotEmpty;
@override
bool get hasLightningSupport => lightningWallet?.sdk != null;
bool get hasLightningSupport => seed != null && LightningWallet.isAvailable;
bool get isPayjoinAvailable => unspentCoinsInfo.values
.where((element) => element.walletId == id && element.isSending && !element.isFrozen)
@@ -727,7 +729,7 @@ abstract class BitcoinWalletBase extends ElectrumWallet with Store {
if (option == BitcoinReceivePageOption.lightning) {
// Lightning is tied to the primary account only
return !isExtraAccount && hasLightningSupport;
return !isExtraAccount && hasLightningSupport && isLightningInitialized;
}
if (option == BitcoinReceivePageOption.silent_payments) {
@@ -171,7 +171,7 @@ abstract class ElectrumWalletAddressesBase extends WalletAddresses with Store {
final Bip32Slip10Secp256k1 legacyMainHd;
final Bip32Slip10Secp256k1 legacySideHd;
final bool isHardwareWallet;
final LightningWallet? lightningWallet;
LightningWallet? lightningWallet;
@observable
ObservableMap<BitcoinAddressType, String> lockedReceiveAddressByType;