From 2cb294fd2afc770f9639da7d2ff94307b47bb672 Mon Sep 17 00:00:00 2001 From: Dennis Reimann Date: Mon, 24 Jun 2024 21:03:28 +0200 Subject: [PATCH] Improve state display on dashboard --- BTCPayApp.UI/Components/SetupStatus.razor | 4 ++-- BTCPayApp.UI/Pages/DashboardPage.razor | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/BTCPayApp.UI/Components/SetupStatus.razor b/BTCPayApp.UI/Components/SetupStatus.razor index 8e43d0e..c467dea 100644 --- a/BTCPayApp.UI/Components/SetupStatus.razor +++ b/BTCPayApp.UI/Components/SetupStatus.razor @@ -46,13 +46,13 @@ public SetupState SetupStateOnchain() { if (SetupStateConnection() != SetupState.Completed || - State.Value.OnchainWalletState is OnChainWalletState.Init or OnChainWalletState.Loading) return SetupState.Undetermined; + State.Value.OnchainWalletState is OnChainWalletState.Loading) return SetupState.Undetermined; return State.Value.OnchainWalletState == OnChainWalletState.Loaded ? SetupState.Completed : SetupState.Pending; } public SetupState SetupStateLightning() { if (SetupStateConnection() != SetupState.Completed || - State.Value.LightningNodeState is LightningNodeState.Init or LightningNodeState.Loading) return SetupState.Undetermined; + State.Value.LightningNodeState is LightningNodeState.Loading) return SetupState.Undetermined; if (State.Value.LightningNodeState is LightningNodeState.Error or LightningNodeState.Stopped) return SetupState.Failed; return State.Value.LightningNodeState == LightningNodeState.Loaded ? SetupState.Completed : SetupState.Pending; } diff --git a/BTCPayApp.UI/Pages/DashboardPage.razor b/BTCPayApp.UI/Pages/DashboardPage.razor index acba161..71d41cb 100644 --- a/BTCPayApp.UI/Pages/DashboardPage.razor +++ b/BTCPayApp.UI/Pages/DashboardPage.razor @@ -86,7 +86,7 @@ -
  • +
  • Set up wallet @switch (SetupStateOnchain) @@ -103,7 +103,7 @@ }
  • -
  • +
  • Configure node @switch (SetupStateLightning) @@ -225,10 +225,10 @@ } } - private SetupState? SetupStateConnection => _setupStatus?.SetupStateConnection() ?? SetupState.Undetermined; - private SetupState? SetupStateAccount => _setupStatus?.SetupStateAccount() ?? SetupState.Undetermined; - private SetupState? SetupStateOnchain => _setupStatus?.SetupStateOnchain() ?? SetupState.Undetermined; - private SetupState? SetupStateLightning => _setupStatus?.SetupStateLightning() ?? SetupState.Undetermined; + private SetupState SetupStateConnection => _setupStatus?.SetupStateConnection() ?? SetupState.Undetermined; + private SetupState SetupStateAccount => _setupStatus?.SetupStateAccount() ?? SetupState.Undetermined; + private SetupState SetupStateOnchain => _setupStatus?.SetupStateOnchain() ?? SetupState.Undetermined; + private SetupState SetupStateLightning => _setupStatus?.SetupStateLightning() ?? SetupState.Undetermined; private IEnumerable? Invoices => StoreState.Value.Invoices?.Data?.Take(5); private bool InvoicesLoading => StoreState.Value.Invoices?.Loading is true;