From 1000db633a0cd1b7fda0f2b26eed2c096f0c8bac Mon Sep 17 00:00:00 2001 From: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Date: Sun, 23 Apr 2023 20:34:02 +0100 Subject: [PATCH] Prevent recursive call on hidden widgets --- preset-text/presetText.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/preset-text/presetText.js b/preset-text/presetText.js index 7720a21..30cc45d 100644 --- a/preset-text/presetText.js +++ b/preset-text/presetText.js @@ -195,8 +195,11 @@ app.registerExtension({ callbacks.push(widget.serializeValue); } + let called = false; const serializeValue = (workflowNode, widgetIndex) => { const widgetValue = widget.value; + if (called) return widgetValue; + called = true; for (const cb of callbacks) { widget.value = cb(workflowNode, widgetIndex); @@ -205,6 +208,8 @@ app.registerExtension({ const prompt = widget.value; widget.value = widgetValue; + called = false; + return prompt; };