break, don't set more than one running state to failed (esp. commplete)

This commit is contained in:
sneurlax 2023-10-17 11:19:12 -05:00
parent 094668cc0c
commit 8f848a4d70

View file

@ -221,22 +221,27 @@ mixin FusionWalletInterface {
if (_uiState?.connecting.status == CashFusionStatus.running) { if (_uiState?.connecting.status == CashFusionStatus.running) {
_uiState?.connecting = _uiState?.connecting =
CashFusionState(status: CashFusionStatus.failed, info: info); CashFusionState(status: CashFusionStatus.failed, info: info);
return;
} }
if (_uiState?.outputs.status == CashFusionStatus.running) { if (_uiState?.outputs.status == CashFusionStatus.running) {
_uiState?.outputs = _uiState?.outputs =
CashFusionState(status: CashFusionStatus.failed, info: info); CashFusionState(status: CashFusionStatus.failed, info: info);
return;
} }
if (_uiState?.peers.status == CashFusionStatus.running) { if (_uiState?.peers.status == CashFusionStatus.running) {
_uiState?.peers = _uiState?.peers =
CashFusionState(status: CashFusionStatus.failed, info: info); CashFusionState(status: CashFusionStatus.failed, info: info);
return;
} }
if (_uiState?.fusing.status == CashFusionStatus.running) { if (_uiState?.fusing.status == CashFusionStatus.running) {
_uiState?.fusing = _uiState?.fusing =
CashFusionState(status: CashFusionStatus.failed, info: info); CashFusionState(status: CashFusionStatus.failed, info: info);
return;
} }
if (_uiState?.complete.status == CashFusionStatus.running) { if (_uiState?.complete.status == CashFusionStatus.running) {
_uiState?.complete = _uiState?.complete =
CashFusionState(status: CashFusionStatus.failed, info: info); CashFusionState(status: CashFusionStatus.failed, info: info);
return;
} }
} }