one more optimization/fix
This commit is contained in:
parent
7e2fb22836
commit
5da78c9553
1 changed files with 31 additions and 28 deletions
|
@ -86,7 +86,9 @@ export function doSetDarkTime(value, options) {
|
|||
}
|
||||
|
||||
export function doSetLanguage(language) {
|
||||
return dispatch => {
|
||||
return (dispatch, getState) => {
|
||||
const { settings } = getState();
|
||||
if (settings.language !== language || !settings.loadedLanguages.include(language)) {
|
||||
// this should match the behavior/logic in index-web.html
|
||||
fetch('https://lbry.com/i18n/get/lbry-desktop/app-strings/' + language + '.json')
|
||||
.then(r => r.json())
|
||||
|
@ -115,5 +117,6 @@ export function doSetLanguage(language) {
|
|||
})
|
||||
);
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue