mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-22 10:45:08 +00:00
disconnect temp fix
This commit is contained in:
parent
a0ef14b3ed
commit
8a3d8ff4ae
1 changed files with 6 additions and 2 deletions
|
@ -186,7 +186,9 @@ abstract class LightningWalletBase extends ElectrumWallet with Store {
|
|||
|
||||
// disconnect if already connected
|
||||
try {
|
||||
await sdk.disconnect();
|
||||
if (await sdk.isInitialized()) {
|
||||
await sdk.disconnect();
|
||||
}
|
||||
} catch (e, s) {
|
||||
print("ERROR disconnecting from Breez: $e\n$s");
|
||||
}
|
||||
|
@ -232,7 +234,9 @@ abstract class LightningWalletBase extends ElectrumWallet with Store {
|
|||
|
||||
Future<void> stopBreez() async {
|
||||
final sdk = await BreezSDK();
|
||||
await sdk.disconnect();
|
||||
if (await sdk.isInitialized()) {
|
||||
await sdk.disconnect();
|
||||
}
|
||||
await _nodeStateSub?.cancel();
|
||||
await _paymentsSub?.cancel();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue