Pass two-letter language code

This commit is contained in:
Ildar Kamalov 2018-11-26 10:55:42 +03:00
parent cdd2e8ecb4
commit 18f210eef5
1 changed files with 2 additions and 1 deletions

View File

@ -500,7 +500,8 @@ export const changeLanguageSuccess = createAction('CHANGE_LANGUAGE_SUCCESS');
export const changeLanguage = lang => async (dispatch) => {
dispatch(changeLanguageRequest());
try {
await apiClient.changeLanguage(lang);
const langCode = lang.substring(0, 2);
await apiClient.changeLanguage(langCode);
dispatch(changeLanguageSuccess());
} catch (error) {
dispatch(addErrorToast({ error }));