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

This commit is contained in:
Kristina
2022-06-29 08:38:09 -05:00
committed by GitHub
parent 40e72c6de3
commit 73ceb25035

View File

@@ -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(() => {