From 75a84c740f8601a232fac7cd68796393d713fa98 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 13 Oct 2023 12:42:16 -0500 Subject: [PATCH] ui stepper --- .../cashfusion/desktop_cashfusion_view.dart | 1 + .../mixins/fusion_wallet_interface.dart | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/lib/pages_desktop_specific/cashfusion/desktop_cashfusion_view.dart b/lib/pages_desktop_specific/cashfusion/desktop_cashfusion_view.dart index eb22f670d..a8ac6fc7b 100644 --- a/lib/pages_desktop_specific/cashfusion/desktop_cashfusion_view.dart +++ b/lib/pages_desktop_specific/cashfusion/desktop_cashfusion_view.dart @@ -648,6 +648,7 @@ class _DesktopCashFusion extends ConsumerState { } unawaited(fusionWallet.fuse()); + unawaited(fusionWallet.stepThruUiStates()); await showDialog( context: context, diff --git a/lib/services/mixins/fusion_wallet_interface.dart b/lib/services/mixins/fusion_wallet_interface.dart index 91740ea78..9d0d91faa 100644 --- a/lib/services/mixins/fusion_wallet_interface.dart +++ b/lib/services/mixins/fusion_wallet_interface.dart @@ -374,4 +374,29 @@ mixin FusionWalletInterface { throw UnimplementedError( "TODO refreshFusion eg look up number of fusion participants connected/coordinating"); } + + /// Testing ground for iterating thru the UI state. + /// + /// TODO remove this, just for development. + Future stepThruUiStates() async { + // Define the list of states. + final List states = [ + fusion.FusionStatus.setup, + fusion.FusionStatus.waiting, + fusion.FusionStatus.connecting, + fusion.FusionStatus.running, + fusion.FusionStatus.complete, + fusion.FusionStatus.failed, + fusion.FusionStatus.exception, + ]; + + // Iterate through the list of states, waiting one second between each. + for (final state in states) { + // Set the connecting status to the current state. + _updateStatus(state); + + // Wait one second. + await Future.delayed(const Duration(seconds: 1)); + } + } }