diff --git a/src/redux/root/init.thunks.ts b/src/redux/root/init.thunks.ts index 96d2232686fbbc91de90fb131de01774cfe566d2..18dabadf7d56d2deb7dc92b21d8ccbedce474aed 100644 --- a/src/redux/root/init.thunks.ts +++ b/src/redux/root/init.thunks.ts @@ -40,6 +40,18 @@ export const fetchInitialAppData = createAsyncThunk< >('appInit/fetchInitialAppData', async ({ queryData }, { dispatch }): Promise<void> => { dispatch(setProjectId({ queryData })); + /** Fetch all data required for rendering map */ + + await Promise.all([ + dispatch(getConstant()), + dispatch(getConfiguration()), + dispatch(getConfigurationOptions()), + dispatch(getProjectById(PROJECT_ID)), + dispatch(getAllBackgroundsByProjectId(PROJECT_ID)), + dispatch(getAllPublicOverlaysByProjectId(PROJECT_ID)), + dispatch(getModels()), + ]); + if (queryData.pluginsId) { await dispatch( getInitPlugins({ @@ -56,17 +68,6 @@ export const fetchInitialAppData = createAsyncThunk< } } - /** Fetch all data required for rendering map */ - - await Promise.all([ - dispatch(getConstant()), - dispatch(getConfiguration()), - dispatch(getConfigurationOptions()), - dispatch(getProjectById(PROJECT_ID)), - dispatch(getAllBackgroundsByProjectId(PROJECT_ID)), - dispatch(getAllPublicOverlaysByProjectId(PROJECT_ID)), - dispatch(getModels()), - ]); /** Set map properties to allow rendering. If map params (modelId,backgroundId,position) are not provided in query -> it will be set to map default */ await Promise.all([ dispatch(initMapSizeAndModelId({ queryData })),