update ui status updates

with example stepper
This commit is contained in:
sneurlax 2023-10-13 13:14:16 -05:00
parent 6877c00a49
commit ac6952f5eb
2 changed files with 9 additions and 8 deletions

View file

@ -648,7 +648,7 @@ class _DesktopCashFusion extends ConsumerState<DesktopCashFusionView> {
} }
unawaited(fusionWallet.fuse()); unawaited(fusionWallet.fuse());
unawaited(fusionWallet.stepThruUiStates()); // unawaited(fusionWallet.stepThruUiStates());
await showDialog<void>( await showDialog<void>(
context: context, context: context,

View file

@ -88,18 +88,19 @@ mixin FusionWalletInterface {
// callback to update the ui state object // callback to update the ui state object
void _updateStatus(fusion.FusionStatus fusionStatus) { void _updateStatus(fusion.FusionStatus fusionStatus) {
switch (fusionStatus) { switch (fusionStatus) {
case fusion.FusionStatus.setup: case fusion.FusionStatus.connecting:
_uiState?.connecting = CashFusionStatus.running; _uiState?.connecting = CashFusionStatus.running;
break; break;
case fusion.FusionStatus.waiting: case fusion.FusionStatus.setup:
_uiState?.connecting = CashFusionStatus.success; _uiState?.connecting = CashFusionStatus.success;
_uiState?.outputs = CashFusionStatus.success; _uiState?.outputs = CashFusionStatus.running;
break; break;
case fusion.FusionStatus.connecting: case fusion.FusionStatus.waiting:
_uiState?.connecting = CashFusionStatus.waiting; _uiState?.outputs = CashFusionStatus.success;
_uiState?.peers = CashFusionStatus.running;
break; break;
case fusion.FusionStatus.running: case fusion.FusionStatus.running:
_uiState?.connecting = CashFusionStatus.success; _uiState?.peers = CashFusionStatus.success;
_uiState?.fusing = CashFusionStatus.running; _uiState?.fusing = CashFusionStatus.running;
break; break;
case fusion.FusionStatus.complete: case fusion.FusionStatus.complete:
@ -391,9 +392,9 @@ mixin FusionWalletInterface {
Future<void> stepThruUiStates() async { Future<void> stepThruUiStates() async {
// Define the list of states. // Define the list of states.
final List<fusion.FusionStatus> states = [ final List<fusion.FusionStatus> states = [
fusion.FusionStatus.connecting,
fusion.FusionStatus.setup, fusion.FusionStatus.setup,
fusion.FusionStatus.waiting, fusion.FusionStatus.waiting,
fusion.FusionStatus.connecting,
fusion.FusionStatus.running, fusion.FusionStatus.running,
fusion.FusionStatus.complete, fusion.FusionStatus.complete,
fusion.FusionStatus.failed, fusion.FusionStatus.failed,