mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
🐛 Fix draggable memory leak (#2503)
* attempt fix
* wrap in try catch
* Revert "wrap in try catch"
4b0444747f
* ⚡ Improve comment
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
parent
b005686ecd
commit
a550093f3e
|
@ -2003,10 +2003,8 @@ export default mixins(
|
||||||
this.$store.commit('renameNodeSelectedAndExecution', { old: currentName, new: newName });
|
this.$store.commit('renameNodeSelectedAndExecution', { old: currentName, new: newName });
|
||||||
|
|
||||||
// Reset all nodes and connections to load the new ones
|
// Reset all nodes and connections to load the new ones
|
||||||
if (this.instance) {
|
this.deleteEveryEndpoint();
|
||||||
// On first load it does not exist
|
|
||||||
this.instance.deleteEveryEndpoint();
|
|
||||||
}
|
|
||||||
this.$store.commit('removeAllConnections');
|
this.$store.commit('removeAllConnections');
|
||||||
this.$store.commit('removeAllNodes', {setStateDirty: true});
|
this.$store.commit('removeAllNodes', {setStateDirty: true});
|
||||||
|
|
||||||
|
@ -2020,6 +2018,16 @@ export default mixins(
|
||||||
this.deselectAllNodes();
|
this.deselectAllNodes();
|
||||||
this.nodeSelectedByName(newName);
|
this.nodeSelectedByName(newName);
|
||||||
},
|
},
|
||||||
|
deleteEveryEndpoint () {
|
||||||
|
// Check as it does not exist on first load
|
||||||
|
if (this.instance) {
|
||||||
|
const nodes = this.$store.getters.allNodes as INodeUi[];
|
||||||
|
// @ts-ignore
|
||||||
|
nodes.forEach((node: INodeUi) => this.instance.destroyDraggable(`${NODE_NAME_PREFIX}${this.$store.getters.getNodeIndex(node.name)}`));
|
||||||
|
|
||||||
|
this.instance.deleteEveryEndpoint();
|
||||||
|
}
|
||||||
|
},
|
||||||
matchCredentials(node: INodeUi) {
|
matchCredentials(node: INodeUi) {
|
||||||
if (!node.credentials) {
|
if (!node.credentials) {
|
||||||
return;
|
return;
|
||||||
|
@ -2336,10 +2344,7 @@ export default mixins(
|
||||||
},
|
},
|
||||||
resetWorkspace () {
|
resetWorkspace () {
|
||||||
// Reset nodes
|
// Reset nodes
|
||||||
if (this.instance) {
|
this.deleteEveryEndpoint();
|
||||||
// On first load it does not exist
|
|
||||||
this.instance.deleteEveryEndpoint();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.executionWaitingForWebhook === true) {
|
if (this.executionWaitingForWebhook === true) {
|
||||||
// Make sure that if there is a waiting test-webhook that
|
// Make sure that if there is a waiting test-webhook that
|
||||||
|
|
Loading…
Reference in a new issue