From 3ef5a2cf537eaa4329bdc20b6365a0506cb08f66 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 6 Jun 2023 15:10:11 -0400 Subject: [PATCH] chore(topology): disable group node actions while checking (#1049) (#1050) Signed-off-by: Thuan Vo (cherry picked from commit 4ccacf75b14825bfbd9418ba0c6e22d0291f97da) Co-authored-by: Thuan Vo --- src/app/Topology/Actions/NodeActions.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/app/Topology/Actions/NodeActions.tsx b/src/app/Topology/Actions/NodeActions.tsx index 1079e5a93..ba1d72fa4 100644 --- a/src/app/Topology/Actions/NodeActions.tsx +++ b/src/app/Topology/Actions/NodeActions.tsx @@ -98,11 +98,16 @@ export const ContextMenuItem: React.FC = ({ if (isDisabled) { addSubscription( elementSubj - .pipe(switchMap((element) => isDisabled(element, { services, notifications, history }))) + .pipe( + switchMap((element) => { + setDisabled(true); + return isDisabled(element, { services, notifications, history }); + }) + ) .subscribe(setDisabled) ); } - }, [addSubscription, elementSubj, isDisabled, services, notifications, history]); + }, [addSubscription, elementSubj, isDisabled, setDisabled, services, notifications, history]); React.useEffect(() => { elementSubj.next(element);