mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-12-24 05:59:51 +05:30
Simplify locales preloading
This commit is contained in:
parent
7c415a0d96
commit
02e767b57c
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user