« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/upd8.js12
1 files changed, 12 insertions, 0 deletions
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,