mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix: Allow pasting a big workflow (#6760)
* fix: pasting a big workflow * chore: update comment * refactor: move try/catch to function * refactor: move try/catch to function
This commit is contained in:
parent
6a6fbb6e6c
commit
a81fdca7bf
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue