From 84df4fd8e4976a8dfb41923c338a50c95cf0c539 Mon Sep 17 00:00:00 2001 From: cristhianzl Date: Thu, 13 Jun 2024 09:33:03 -0300 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20(authContext.tsx):=20remov?= =?UTF-8?q?e=20unused=20import=20and=20comment=20out=20unused=20code=20?= =?UTF-8?q?=F0=9F=90=9B=20(flowSettingsModal):=20fix=20potential=20null=20?= =?UTF-8?q?reference=20error=20in=20useEffect=20dependencies?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/src/contexts/authContext.tsx | 5 ++--- src/frontend/src/modals/flowSettingsModal/index.tsx | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/frontend/src/contexts/authContext.tsx b/src/frontend/src/contexts/authContext.tsx index fbb7f8f1e..b37816571 100644 --- a/src/frontend/src/contexts/authContext.tsx +++ b/src/frontend/src/contexts/authContext.tsx @@ -3,7 +3,6 @@ import { useNavigate } from "react-router-dom"; import Cookies from "universal-cookie"; import { getLoggedUser, requestLogout } from "../controllers/API"; import useAlertStore from "../stores/alertStore"; -import { useFolderStore } from "../stores/foldersStore"; import { Users } from "../types/api"; import { AuthContextType } from "../types/contexts/auth"; @@ -43,7 +42,7 @@ export function AuthProvider({ children }): React.ReactElement { const [apiKey, setApiKey] = useState( cookies.get("apikey_tkn_lflw"), ); - const getFoldersApi = useFolderStore((state) => state.getFoldersApi); + // const getFoldersApi = useFolderStore((state) => state.getFoldersApi); useEffect(() => { const storedAccessToken = cookies.get("access_token_lf"); @@ -65,7 +64,7 @@ export function AuthProvider({ children }): React.ReactElement { setUserData(user); const isSuperUser = user!.is_superuser; setIsAdmin(isSuperUser); - await getFoldersApi(true); + // await getFoldersApi(true); }) .catch((error) => { setLoading(false); diff --git a/src/frontend/src/modals/flowSettingsModal/index.tsx b/src/frontend/src/modals/flowSettingsModal/index.tsx index f8d62b7fb..912097a01 100644 --- a/src/frontend/src/modals/flowSettingsModal/index.tsx +++ b/src/frontend/src/modals/flowSettingsModal/index.tsx @@ -18,7 +18,7 @@ export default function FlowSettingsModal({ useEffect(() => { setName(currentFlow!.name); setDescription(currentFlow!.description); - }, [currentFlow!.name, currentFlow!.description, open]); + }, [currentFlow?.name, currentFlow?.description, open]); const [name, setName] = useState(currentFlow!.name); const [description, setDescription] = useState(currentFlow!.description);