diff --git a/src/Node.svelte b/src/Node.svelte index 7712045..58ba87d 100644 --- a/src/Node.svelte +++ b/src/Node.svelte @@ -11,6 +11,12 @@ removeNode(id); } + function resetNode() { + // hack to deselect node and apply changes on chrome + $nodes.find(n => n.id === id).selected = false; + $nodes = $nodes + } + function changeFile() { const newFile = OUTPUTNAMES.find((n) => n.name === data.name); data.inputs = [...newFile.inputs]; @@ -18,9 +24,7 @@ data.ext = newFile.ext; data = data; - // hack to deselect node and apply changes on chrome - $nodes.find(n => n.id === id).selected = false; - $nodes = $nodes + resetNode(); } @@ -33,7 +37,7 @@