fix: bug in setting _isConnected as well as adding call to refresh on reconnection established

This commit is contained in:
julian 2023-05-29 09:54:14 -06:00
parent bad1eed7c8
commit f113904a22

View file

@ -1201,13 +1201,18 @@ class BitcoinWallet extends CoinServiceAPI
void _periodicPingCheck() async {
bool hasNetwork = await testNetworkConnection();
_isConnected = hasNetwork;
if (_isConnected != hasNetwork) {
NodeConnectionStatus status = hasNetwork
? NodeConnectionStatus.connected
: NodeConnectionStatus.disconnected;
GlobalEventBus.instance
.fire(NodeConnectionStatusChangedEvent(status, walletId, coin));
_isConnected = hasNetwork;
if (hasNetwork) {
unawaited(refresh());
}
}
}