mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-09 04:09:25 +00:00
fix: optional cast error
This commit is contained in:
parent
ba1ab977d6
commit
4fc2a7acfa
2 changed files with 9 additions and 5 deletions
|
@ -234,10 +234,12 @@ class _WalletNetworkSettingsViewState
|
||||||
_percent = 1;
|
_percent = 1;
|
||||||
_blocksRemaining = 0;
|
_blocksRemaining = 0;
|
||||||
} else {
|
} else {
|
||||||
_percent =
|
final wallet = ref.read(pWallets).getWallet(widget.walletId);
|
||||||
(ref.read(pWallets).getWallet(widget.walletId) as ElectrumXInterface?)
|
if (wallet is ElectrumXInterface) {
|
||||||
?.refreshingPercent ??
|
_percent = wallet.refreshingPercent ?? 0;
|
||||||
0;
|
} else {
|
||||||
|
_percent = 0;
|
||||||
|
}
|
||||||
_blocksRemaining = -1;
|
_blocksRemaining = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -565,7 +565,9 @@ abstract class Wallet<T extends CryptoCurrency> {
|
||||||
}
|
}
|
||||||
|
|
||||||
void _fireRefreshPercentChange(double percent) {
|
void _fireRefreshPercentChange(double percent) {
|
||||||
(this as ElectrumXInterface?)?.refreshingPercent = percent;
|
if (this is ElectrumXInterface) {
|
||||||
|
(this as ElectrumXInterface?)?.refreshingPercent = percent;
|
||||||
|
}
|
||||||
GlobalEventBus.instance.fire(RefreshPercentChangedEvent(percent, walletId));
|
GlobalEventBus.instance.fire(RefreshPercentChangedEvent(percent, walletId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue