Skip to content

Commit 10b1b6b

Browse files
committed
fix re-caching
also update localization of app window when new locales are downloaded
1 parent 68f28df commit 10b1b6b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

userscript/fa-blacklist-latest.user.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,14 +1156,15 @@ var i18n = {
11561156
.then(convertToJSON)
11571157
.then(function (locales) {
11581158
if (!locales || locales._version !== meta.VERSION) {
1159-
return i18n._updateLocales(locales || {});
1159+
return i18n._updateLocales(locales);
11601160
} else {
11611161
i18n._locales = locales;
11621162
return true;
11631163
}
11641164
});
11651165
},
11661166
_updateLocales: function (locales) {
1167+
locales = locales || {};
11671168
console.log('Fetching new locales dictionary');
11681169
var localesURL = (new URL(meta.LOCALES_HREF, meta.ROOT)).href;
11691170
console.log(localesURL);
@@ -2529,6 +2530,7 @@ var OptionsForm = {
25292530
OptionsForm.$reloadCaches.addEventListener('click', function (e) {
25302531
i18n._updateLocales();
25312532
App._reloadStylesheet();
2533+
App.applyLocalization();
25322534
}, false);
25332535
},
25342536
serialize: function () {
@@ -3367,7 +3369,9 @@ var App = {
33673369
return App.$mainWindow;
33683370
},
33693371
_reloadStylesheet: function () {
3370-
return fetch((new URL(meta.STYLES_HREF, meta.ROOT)).href)
3372+
var stylesheetURL = (new URL(meta.STYLES_HREF, meta.ROOT)).href;
3373+
console.log('Fetching stylesheet', stylesheetURL);
3374+
return fetch(stylesheetURL)
33713375
.then(function (x) {return x.text()})
33723376
.then(function (stylesheet) {
33733377
App.$stylesheet.innerHTML = stylesheet;

0 commit comments

Comments
 (0)