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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,13 +47,11 @@ export const CommandPalette = () => {
}); });
useEffect(() => { useEffect(() => {
(async () => { if (isNotLogin) {
if (isNotLogin) { const staticActionsResp = getGlobalActions(navBarTree);
setStaticActions(getGlobalActions(navBarTree)); setStaticActions(staticActionsResp);
setActions(staticActions); setActions([...staticActionsResp]);
} }
})();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isNotLogin, navBarTree]); }, [isNotLogin, navBarTree]);
useEffect(() => { useEffect(() => {