Remove change_language call on loading app
This commit is contained in:
parent
18f210eef5
commit
903c1da993
|
@ -500,8 +500,7 @@ export const changeLanguageSuccess = createAction('CHANGE_LANGUAGE_SUCCESS');
|
||||||
export const changeLanguage = lang => async (dispatch) => {
|
export const changeLanguage = lang => async (dispatch) => {
|
||||||
dispatch(changeLanguageRequest());
|
dispatch(changeLanguageRequest());
|
||||||
try {
|
try {
|
||||||
const langCode = lang.substring(0, 2);
|
await apiClient.changeLanguage(lang);
|
||||||
await apiClient.changeLanguage(langCode);
|
|
||||||
dispatch(changeLanguageSuccess());
|
dispatch(changeLanguageSuccess());
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
dispatch(addErrorToast({ error }));
|
dispatch(addErrorToast({ error }));
|
||||||
|
|
|
@ -39,9 +39,7 @@ class App extends Component {
|
||||||
const { processing, language } = this.props.dashboard;
|
const { processing, language } = this.props.dashboard;
|
||||||
|
|
||||||
if (!processing) {
|
if (!processing) {
|
||||||
if (!language) {
|
if (language) {
|
||||||
this.props.changeLanguage(i18n.language);
|
|
||||||
} else {
|
|
||||||
i18n.changeLanguage(language);
|
i18n.changeLanguage(language);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue