Fix preview output

This commit is contained in:
Zuellni
2023-11-22 16:14:28 +01:00
parent 51bb1bcf84
commit 72a44cbcca
+4
View File
@@ -5,7 +5,11 @@ app.registerExtension({
name: "ZuellniText", name: "ZuellniText",
async beforeRegisterNodeDef(nodeType, nodeData, app) { async beforeRegisterNodeDef(nodeType, nodeData, app) {
if (nodeData.name === "ZuellniTextPreview") { if (nodeData.name === "ZuellniTextPreview") {
const onExecuted = nodeType.prototype.onExecuted;
nodeType.prototype.onExecuted = function(message) { nodeType.prototype.onExecuted = function(message) {
onExecuted?.apply(this, arguments);
if (this.widgets) { if (this.widgets) {
const index = this.widgets.findIndex((w) => w.name === "output"); const index = this.widgets.findIndex((w) => w.name === "output");