ensure failed state is reset so that the retry button is not shown when fusing again or after tapping retry

This commit is contained in:
julian 2023-10-24 17:04:09 -06:00
parent a2b20316ce
commit 4d71d3dec6
2 changed files with 12 additions and 0 deletions

View file

@ -232,6 +232,17 @@ class _FusionProgressViewState extends ConsumerState<FusionProgressView> {
final fusionInfo = ref.read(prefsChangeNotifierProvider).fusionServerInfo; final fusionInfo = ref.read(prefsChangeNotifierProvider).fusionServerInfo;
try {
fusionWallet.uiState = ref.read(
fusionProgressUIStateProvider(widget.walletId),
);
} catch (e) {
if (!e.toString().contains(
"FusionProgressUIState was already set for ${widget.walletId}")) {
rethrow;
}
}
unawaited(fusionWallet.fuse(fusionInfo: fusionInfo)); unawaited(fusionWallet.fuse(fusionInfo: fusionInfo));
} }
} }

View file

@ -228,6 +228,7 @@ mixin FusionWalletInterface {
CashFusionState(status: CashFusionStatus.waiting, info: info); CashFusionState(status: CashFusionStatus.waiting, info: info);
_uiState?.fusionState = _uiState?.fusionState =
CashFusionState(status: CashFusionStatus.waiting, info: info); CashFusionState(status: CashFusionStatus.waiting, info: info);
_uiState?.failed = false;
break; break;
} }
} }