From 45d252849eedc635815af2cd9fde8215890df6b7 Mon Sep 17 00:00:00 2001 From: Gabriel Viganotti Date: Mon, 9 Dec 2024 17:15:17 -0300 Subject: [PATCH] fix: do not await node removal action when multiple selected --- src/node_actions.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/node_actions.rs b/src/node_actions.rs index 8101ffd..a52c0ce 100644 --- a/src/node_actions.rs +++ b/src/node_actions.rs @@ -24,7 +24,7 @@ const DEFAULT_METRICS_PORT: u16 = 14000; const REWARDS_ADDR_LENGTH: usize = 40; // Action to apply on a node instance -#[derive(Clone, Debug)] +#[derive(Clone, Debug, PartialEq)] pub enum NodeAction { Start, Stop, @@ -141,7 +141,12 @@ pub fn NodesActionsView() -> impl IntoView { } action.apply(&info).await; - while !was_cancelled() && info.read().status.is_transitioning() { + + // let's await for it to finish transitioning unless it was a removal action + while action != NodeAction::Remove + && !was_cancelled() + && info.read().status.is_transitioning() + { sleep(Duration::from_millis(NODES_LIST_POLLING_FREQ_MILLIS)).await; } }