diff --git a/src/js/components/BentoAppRouter.tsx b/src/js/components/BentoAppRouter.tsx index c94eee59..67ab9e5d 100644 --- a/src/js/components/BentoAppRouter.tsx +++ b/src/js/components/BentoAppRouter.tsx @@ -26,33 +26,19 @@ const BentoAppRouter = () => { const isAuthenticated = useIsAuthenticated(); useEffect(() => { - const fetchInitialData = async () => { - try { - await Promise.all([dispatch(makeGetDataRequestThunk()), dispatch(makeGetSearchFields())]); - - const followUpPromises = [ - dispatch(makeGetConfigRequest()), - dispatch(populateClickable()), - dispatch(makeGetAboutRequest()), - dispatch(getBeaconConfig()), - dispatch(makeGetProvenanceRequest()), - dispatch(makeGetKatsuPublic()), - dispatch(fetchKatsuData()), - dispatch(fetchGohanData()), - dispatch(makeGetServiceInfoRequest()), - ]; - - if (isAuthenticated) { - followUpPromises.push(dispatch(makeGetDataTypes())); - } - - await Promise.all(followUpPromises); - } catch (error) { - console.error('Error fetching initial data', error); - } - }; - - fetchInitialData(); + dispatch(makeGetConfigRequest()).then(() => dispatch(getBeaconConfig())); + dispatch(makeGetAboutRequest()); + dispatch(makeGetDataRequestThunk()); + dispatch(makeGetSearchFields()).then(() => dispatch(populateClickable())); + dispatch(makeGetProvenanceRequest()); + dispatch(makeGetKatsuPublic()); + dispatch(fetchKatsuData()); + dispatch(fetchGohanData()); + dispatch(makeGetServiceInfoRequest()); + + if (isAuthenticated) { + dispatch(makeGetDataTypes()); + } }, [isAuthenticated]); if (isAutoAuthenticating) {