From e7d664c13770beb7de9af2820cdba873ad6e55c7 Mon Sep 17 00:00:00 2001 From: m957ymj75urz Date: Sun, 19 Feb 2023 20:37:29 +0100 Subject: [PATCH] jankyness fix : do not wait for the server response to restore prompt --- webshit/index.html | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/webshit/index.html b/webshit/index.html index d86efe14..96fddf9b 100644 --- a/webshit/index.html +++ b/webshit/index.html @@ -418,10 +418,6 @@ function promptPosted(data) wid.to_randomize.value = Math.floor(Math.random() * 1125899906842624); } } - - // restore initial values replaced by dynamic prompting - if (wid.dynamic_prompt && wid.dynamic_prompt === true) - wid.value = wid.value_initial; } } @@ -451,6 +447,16 @@ function postPrompt(number) { // console.log(JSON.stringify(prompt)); // console.log(JSON.stringify(graph.serialize())); + + // restore initial values replaced by dynamic prompting + for (let x in graph._nodes_by_id) { + let n = graph._nodes_by_id[x]; + for (let w in n.widgets) { + let wid = n.widgets[w]; + if (wid.dynamic_prompt && wid.dynamic_prompt === true) + wid.value = wid.value_initial; + } + } }