diff --git a/src/frontend/src/states/ServerApiState.tsx b/src/frontend/src/states/ServerApiState.tsx index 43acde80f8..9a3a313981 100644 --- a/src/frontend/src/states/ServerApiState.tsx +++ b/src/frontend/src/states/ServerApiState.tsx @@ -37,27 +37,29 @@ export const useServerApiState = create()( server: emptyServerAPI, setServer: (newServer: ServerAPIProps) => set({ server: newServer }), fetchServerApiState: async () => { - // Fetch server data - await api - .get(apiUrl(ApiEndpoints.api_server_info)) - .then((response) => { - set({ server: response.data }); - }) - .catch(() => { - console.error('ERR: Error fetching server info'); - }); + await Promise.all([ + // Fetch server data + api + .get(apiUrl(ApiEndpoints.api_server_info)) + .then((response) => { + set({ server: response.data }); + }) + .catch(() => { + console.error('ERR: Error fetching server info'); + }), - // Fetch login/SSO behaviour - await api - .get(apiUrl(ApiEndpoints.auth_config), { - headers: { Authorization: '' } - }) - .then((response) => { - set({ auth_config: response.data.data }); - }) - .catch(() => { - console.error('ERR: Error fetching SSO information'); - }); + // Fetch login/SSO behaviour + api + .get(apiUrl(ApiEndpoints.auth_config), { + headers: { Authorization: '' } + }) + .then((response) => { + set({ auth_config: response.data.data }); + }) + .catch(() => { + console.error('ERR: Error fetching SSO information'); + }) + ]); }, auth_config: undefined, auth_context: undefined,