one more optimization/fix

This commit is contained in:
Jeremy Kauffman 2019-11-12 17:25:44 -05:00 committed by Sean Yesmunt
parent 7e2fb22836
commit 5da78c9553

View file

@ -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) {
})
);
});
}
};
}