fix(dtmm): Fix disabled state of deployment buttons

This commit is contained in:
Lucas Schwiderski 2023-02-28 16:09:47 +01:00
parent 91020c02e1
commit a1a7e9a26e
Signed by: lucas
GPG key ID: AA12679AAA6DF4D8

View file

@ -58,7 +58,9 @@ fn build_top_bar() -> impl Widget<State> {
.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<State> {
.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)