From a1a7e9a26ea14f7a86aec368f33730394d19152b Mon Sep 17 00:00:00 2001 From: Lucas Schwiderski Date: Tue, 28 Feb 2023 16:09:47 +0100 Subject: [PATCH] fix(dtmm): Fix disabled state of deployment buttons --- crates/dtmm/src/ui/window/main.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/dtmm/src/ui/window/main.rs b/crates/dtmm/src/ui/window/main.rs index 6b98d85..d42143c 100644 --- a/crates/dtmm/src/ui/window/main.rs +++ b/crates/dtmm/src/ui/window/main.rs @@ -58,7 +58,9 @@ fn build_top_bar() -> impl Widget { .on_click(|ctx, _state: &mut State, _env| { ctx.submit_command(ACTION_START_DEPLOY); }) - .disabled_if(|data, _| !data.is_deployment_in_progress), + .disabled_if(|data, _| { + data.is_deployment_in_progress || data.is_reset_in_progress + }), ) .with_default_spacer() .with_child( @@ -66,7 +68,9 @@ fn build_top_bar() -> impl Widget { .on_click(|ctx, _state: &mut State, _env| { ctx.submit_command(ACTION_START_RESET_DEPLOYMENT); }) - .disabled_if(|data, _| !data.is_reset_in_progress), + .disabled_if(|data, _| { + data.is_deployment_in_progress || data.is_reset_in_progress + }), ), ) .padding(theme::TOP_BAR_INSETS)