Remove async, set static actions from response and not state variable (#51556)

pull/51504/head^2
Kristina 3 years ago committed by GitHub
parent 40e72c6de3
commit 73ceb25035
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      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(() => {

Loading…
Cancel
Save