Prevent recursive call on hidden widgets

This commit is contained in:
pythongosssss
2023-04-23 20:34:02 +01:00
parent 7e9ab75c5a
commit 1000db633a
+5
View File
@@ -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;
};