diff --git a/src/components/application-loader/application-loader.tsx b/src/components/application-loader/application-loader.tsx index f81a8666a..675070adf 100644 --- a/src/components/application-loader/application-loader.tsx +++ b/src/components/application-loader/application-loader.tsx @@ -10,7 +10,7 @@ export const ApplicationLoader: React.FC = ({ children }) => { const [doneTasks, setDoneTasks] = useState(0) const [initTasks, setInitTasks] = useState([]) const { pathname } = useLocation() - const [applicationLoading, setApplicationLoading] = useState(false) + const [tasksAlreadyTriggered, setTasksAlreadyTriggered] = useState(false) const runTask = async (task: Promise): Promise => { await task @@ -20,14 +20,14 @@ export const ApplicationLoader: React.FC = ({ children }) => { } useEffect(() => { - if (applicationLoading) { + if (tasksAlreadyTriggered) { return } - setApplicationLoading(true) + setTasksAlreadyTriggered(true) const baseUrl:string = window.location.pathname.replace(pathname, '') + '/' console.debug('Base URL is', baseUrl) setInitTasks(setUp(baseUrl)) - }, [applicationLoading, pathname]) + }, [tasksAlreadyTriggered, pathname]) useEffect(() => { for (const task of initTasks) {