refresh button null error fix

This commit is contained in:
julian 2023-02-27 11:59:31 -06:00
parent 6771e39e8a
commit b6f58e4ce1

View file

@ -66,7 +66,19 @@ class _RefreshButtonState extends ConsumerState<WalletRefreshButton>
eventBus.on<WalletSyncStatusChangedEvent>().listen(
(event) async {
if (event.walletId == widget.walletId &&
widget.tokenContractAddress == null ||
widget.tokenContractAddress == null) {
switch (event.newStatus) {
case WalletSyncStatus.unableToSync:
_spinController?.stop();
break;
case WalletSyncStatus.synced:
_spinController?.stop();
break;
case WalletSyncStatus.syncing:
unawaited(_spinController?.repeat());
break;
}
} else if (widget.tokenContractAddress != null &&
event.walletId == widget.walletId + widget.tokenContractAddress!) {
switch (event.newStatus) {
case WalletSyncStatus.unableToSync: