Fixed: Ensure translations are fetched before loading app

(cherry picked from commit ad2721dc55f3233e4c299babe5744418bc530418)

Closes #2670
Closes #2674
Closes #2679
This commit is contained in:
Mark McDowall
2023-07-14 16:55:25 -07:00
committed by Bogdan
parent 8bb52105fd
commit f7c135faaf
6 changed files with 46 additions and 23 deletions
+7 -2
View File
@@ -1,8 +1,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 './preload';
import './polyfills';
@@ -10,12 +9,18 @@ import 'Styles/globals.css';
import './index.css';
const history = createBrowserHistory();
const hasTranslationsError = !await fetchTranslations();
const { default: createAppStore } = await import('Store/createAppStore');
const { default: App } = await import('./App/App');
const store = createAppStore(history);
render(
<App
store={store}
history={history}
hasTranslationsError={hasTranslationsError}
/>,
document.getElementById('root')
);