diff --git a/public/app/features/commandPalette/CommandPalette.tsx b/public/app/features/commandPalette/CommandPalette.tsx index fe6bb59c5cd..d70b21be277 100644 --- a/public/app/features/commandPalette/CommandPalette.tsx +++ b/public/app/features/commandPalette/CommandPalette.tsx @@ -47,13 +47,11 @@ export const CommandPalette = () => { }); useEffect(() => { - (async () => { - if (isNotLogin) { - setStaticActions(getGlobalActions(navBarTree)); - setActions(staticActions); - } - })(); - // eslint-disable-next-line react-hooks/exhaustive-deps + if (isNotLogin) { + const staticActionsResp = getGlobalActions(navBarTree); + setStaticActions(staticActionsResp); + setActions([...staticActionsResp]); + } }, [isNotLogin, navBarTree]); useEffect(() => {