refactor(editor): highlight error when jstoolkit objects are not deleted (#4451)

* remove try/catch

* update try catch
This commit is contained in:
Mutasem Aldmour
2022-10-27 09:39:39 +02:00
committed by GitHub
parent d1b4d428cb
commit 839f6ac777

View File

@@ -2752,13 +2752,18 @@ export default mixins(
deleteEveryEndpoint() {
// Check as it does not exist on first load
if (this.instance) {
try {
const nodes = this.$store.getters.allNodes as INodeUi[];
// @ts-ignore
nodes.forEach((node: INodeUi) => this.instance.destroyDraggable(node.id));
const nodes = this.$store.getters.allNodes as INodeUi[];
nodes.forEach((node: INodeUi) => {
try {
// important to prevent memory leak
// @ts-ignore
this.instance.destroyDraggable(node.id);
} catch (e) {
console.error(e);
}
});
this.instance.deleteEveryEndpoint();
} catch (e) { }
this.instance.deleteEveryEndpoint();
}
},
matchCredentials(node: INodeUi) {