diff --git a/src/frontend/src/App.tsx b/src/frontend/src/App.tsx index 44f5261bd..3b88ee14c 100644 --- a/src/frontend/src/App.tsx +++ b/src/frontend/src/App.tsx @@ -1,6 +1,5 @@ import _ from "lodash"; import { useContext, useEffect, useState } from "react"; -import { useLocation } from "react-router-dom"; import "reactflow/dist/style.css"; import "./App.css"; @@ -21,16 +20,9 @@ import Router from "./routes"; import useAlertStore from "./stores/alertStore"; import { useDarkStore } from "./stores/darkStore"; import useFlowsManagerStore from "./stores/flowsManagerStore"; -import { useLocationStore } from "./stores/locationStore"; import { useTypesStore } from "./stores/typesStore"; export default function App() { - const setCurrent = useLocationStore((state) => state.setCurrent); - - let location = useLocation(); - useEffect(() => { - setCurrent(location.pathname.replace(/\/$/g, "").split("/")); - }, [location.pathname, setCurrent]); const errorData = useAlertStore((state) => state.errorData); const errorOpen = useAlertStore((state) => state.errorOpen); diff --git a/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx index 7adf33c09..ae030e0b7 100644 --- a/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx @@ -17,7 +17,6 @@ import Chat from "../../../../components/chatComponent"; import useAlertStore from "../../../../stores/alertStore"; import useFlowStore from "../../../../stores/flowStore"; import useFlowsManagerStore from "../../../../stores/flowsManagerStore"; -import { useLocationStore } from "../../../../stores/locationStore"; import { useTypesStore } from "../../../../stores/typesStore"; import { APIClassType } from "../../../../types/api"; import { FlowType, NodeType, targetHandleType } from "../../../../types/flow"; diff --git a/src/frontend/src/stores/locationStore.tsx b/src/frontend/src/stores/locationStore.tsx deleted file mode 100644 index 630bbeefa..000000000 --- a/src/frontend/src/stores/locationStore.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { create } from "zustand"; -import { LocationStoreType } from "../types/zustand/location"; - -export const useLocationStore = create((set, get) => ({ - current: window.location.pathname.replace(/\/$/g, "").split("/"), - isStackedOpen: - window.innerWidth > 1024 && window.location.pathname.split("/")[1] - ? true - : false, - setCurrent: (newState) => { - set({ current: newState }); - }, -})); diff --git a/src/frontend/src/types/zustand/location/index.ts b/src/frontend/src/types/zustand/location/index.ts deleted file mode 100644 index 5b6e690a7..000000000 --- a/src/frontend/src/types/zustand/location/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type LocationStoreType = { - current: Array; - setCurrent: (newState: Array) => void; -};