diff --git a/packages/editor-ui/src/components/Node.vue b/packages/editor-ui/src/components/Node.vue index d5ce834799..08ca458cc0 100644 --- a/packages/editor-ui/src/components/Node.vue +++ b/packages/editor-ui/src/components/Node.vue @@ -502,7 +502,9 @@ export default defineComponent({ } }, mounted() { - this.setSubtitle(); + setTimeout(() => { + this.setSubtitle(); + }, 0); if (this.nodeRunData) { setTimeout(() => { this.$emit('run', { @@ -539,10 +541,18 @@ export default defineComponent({ this.unwatchWorkflowDataItems(); }, setSubtitle() { - const nodeSubtitle = - this.getNodeSubtitle(this.data, this.nodeType, this.getCurrentWorkflow()) || ''; + // why is this not a computed property? because it's a very expensive operation + // it requires expressions to resolve each subtitle... + // and ends up bogging down the UI with big workflows, for example when pasting a workflow or even opening a node... + // so we only update it when necessary (when node is mounted and when it's opened and closed (isActive)) + try { + const nodeSubtitle = + this.getNodeSubtitle(this.data, this.nodeType, this.getCurrentWorkflow()) || ''; - this.nodeSubtitle = nodeSubtitle.includes(CUSTOM_API_CALL_KEY) ? '' : nodeSubtitle; + this.nodeSubtitle = nodeSubtitle.includes(CUSTOM_API_CALL_KEY) ? '' : nodeSubtitle; + } catch (e) { + // avoid breaking UI if expression error occurs + } }, disableNode() { if (this.data !== null) {