diff --git a/src/components/application-loader/application-loader.tsx b/src/components/application-loader/application-loader.tsx index b2ea55e60..f81a8666a 100644 --- a/src/components/application-loader/application-loader.tsx +++ b/src/components/application-loader/application-loader.tsx @@ -10,6 +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 runTask = async (task: Promise): Promise => { await task @@ -19,10 +20,14 @@ export const ApplicationLoader: React.FC = ({ children }) => { } useEffect(() => { + if (applicationLoading) { + return + } + setApplicationLoading(true) const baseUrl:string = window.location.pathname.replace(pathname, '') + '/' console.debug('Base URL is', baseUrl) setInitTasks(setUp(baseUrl)) - }, [pathname]) + }, [applicationLoading, pathname]) useEffect(() => { for (const task of initTasks) {