Simplify locales preloading

This commit is contained in:
ErickSkrauch 2020-06-09 21:01:54 +03:00
parent 7c415a0d96
commit 02e767b57c
No known key found for this signature in database
GPG Key ID: 669339FCBB30EE0E

View File

@ -2,7 +2,6 @@ import { authenticate, logoutStrangers } from 'app/components/accounts/actions';
import { getActiveAccount } from 'app/components/accounts/reducer'; import { getActiveAccount } from 'app/components/accounts/reducer';
import request from 'app/services/request'; import request from 'app/services/request';
import { Store } from 'app/reducers'; import { Store } from 'app/reducers';
import i18n from 'app/services/i18n';
import { changeLang } from './actions'; import { changeLang } from './actions';
import bearerHeaderMiddleware from './middlewares/bearerHeaderMiddleware'; import bearerHeaderMiddleware from './middlewares/bearerHeaderMiddleware';
@ -45,10 +44,6 @@ export function factory(store: Store): Promise<void> {
// auto-detect guest language // auto-detect guest language
await store.dispatch(changeLang(user.lang)); await store.dispatch(changeLang(user.lang));
})
.then(() => {
// Preload the current locale before app will be started
i18n.require(store.getState().i18n.locale);
}); });
return promise; return promise;