From 72c9ff67635f437232447de269ee4955eba1f04d Mon Sep 17 00:00:00 2001 From: somebody Date: Sat, 10 Dec 2022 10:53:42 -0600 Subject: [PATCH] Fix checkbox syncing and disrupt on reset --- static/koboldai.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/static/koboldai.js b/static/koboldai.js index 204825a4..352d12c5 100644 --- a/static/koboldai.js +++ b/static/koboldai.js @@ -251,6 +251,7 @@ function disruptStoryState() { function reset_story() { //console.log("Resetting story"); + disruptStoryState(); clearTimeout(calc_token_usage_timeout); clearTimeout(game_text_scroll_timeout); clearTimeout(font_size_cookie_timout); @@ -6834,6 +6835,7 @@ function imgGenRetry() { class: "story", name: "commentary_enabled", func: function(commentaryEnabled) { + this.checked = commentaryEnabled; if (commentaryEnabled) { settingsContainer.classList.remove("disabled"); } else { @@ -6860,11 +6862,17 @@ for (const el of document.querySelectorAll("[sync-var]")) { sync_to_server(this); }); + + const proxy = $el(`[sync-proxy-host="${varName}"]`); if (proxy) { el.addEventListener("input", function() { proxy.value = this.value; }); + + el.addEventListener("sync", function() { + proxy.value = this.value; + }); } let slug = varName.replaceAll(".", "_");