mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-22 10:34:32 +00:00
fix: bug in setting _isConnected as well as adding call to refresh on reconnection established
This commit is contained in:
parent
bad1eed7c8
commit
f113904a22
1 changed files with 6 additions and 1 deletions
|
@ -1201,13 +1201,18 @@ class BitcoinWallet extends CoinServiceAPI
|
||||||
|
|
||||||
void _periodicPingCheck() async {
|
void _periodicPingCheck() async {
|
||||||
bool hasNetwork = await testNetworkConnection();
|
bool hasNetwork = await testNetworkConnection();
|
||||||
_isConnected = hasNetwork;
|
|
||||||
if (_isConnected != hasNetwork) {
|
if (_isConnected != hasNetwork) {
|
||||||
NodeConnectionStatus status = hasNetwork
|
NodeConnectionStatus status = hasNetwork
|
||||||
? NodeConnectionStatus.connected
|
? NodeConnectionStatus.connected
|
||||||
: NodeConnectionStatus.disconnected;
|
: NodeConnectionStatus.disconnected;
|
||||||
GlobalEventBus.instance
|
GlobalEventBus.instance
|
||||||
.fire(NodeConnectionStatusChangedEvent(status, walletId, coin));
|
.fire(NodeConnectionStatusChangedEvent(status, walletId, coin));
|
||||||
|
|
||||||
|
_isConnected = hasNetwork;
|
||||||
|
if (hasNetwork) {
|
||||||
|
unawaited(refresh());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue