From d3930822b87e01ae85bbc7e1f3f2598d8f680187 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 9 Jan 2024 11:32:03 -0400 Subject: upd8: provide closeLanguageWatchers function --- src/upd8.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/upd8.js') diff --git a/src/upd8.js b/src/upd8.js index d001c76a..5b6b4403 100755 --- a/src/upd8.js +++ b/src/upd8.js @@ -1539,6 +1539,17 @@ async function main() { } } + const closeLanguageWatchers = () => { + if (languageReloading) { + for (const watcher of [ + internalDefaultLanguageWatcher, + ...customLanguageWatchers, + ]) { + watcher.close(); + } + } + }; + const inheritStringsFromInternalLanguage = () => { // The custom default language, if set, will be the new one providing fallback // strings for other languages. But on its own, it still might not be a complete @@ -1792,6 +1803,7 @@ async function main() { wikiData, cachebust: '?' + CACHEBUST, + closeLanguageWatchers, developersComment, getSizeOfAdditionalFile, getSizeOfImagePath, -- cgit 1.3.0-6-gf8a5