Fixed: Ensure translations are fetched before loading app

(cherry picked from commit ad2721dc55f3233e4c299babe5744418bc530418)

Closes #3868
Closes #3871
This commit is contained in:
Mark McDowall 2023-07-14 16:55:25 -07:00 committed by Bogdan
parent 34ad4ef337
commit eeaea17c1f
6 changed files with 38 additions and 18 deletions

View file

@ -2,7 +2,7 @@ import { createBrowserHistory } from 'history';
import React from 'react';
import { render } from 'react-dom';
import createAppStore from 'Store/createAppStore';
import App from './App/App';
import { fetchTranslations } from 'Utilities/String/translate';
import 'Diag/ConsoleApi';
import './preload';
@ -12,11 +12,14 @@ import './index.css';
const history = createBrowserHistory();
const store = createAppStore(history);
const hasTranslationsError = !await fetchTranslations();
const { default: App } = await import('./App/App');
render(
<App
store={store}
history={history}
hasTranslationsError={hasTranslationsError}
/>,
document.getElementById('root')
);