From bcaeccfc4557544cb70b68794ab0a66eb0d0c35d Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Thu, 13 Mar 2025 11:35:05 +1100 Subject: [PATCH] Fix #346 last reroute is never deleted (#766) Clears the reroutes in extras when exporting for serialisation, if none exist. - Resolves #346 --- src/LGraph.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/LGraph.ts b/src/LGraph.ts index a5ce449bc..d21cc309a 100644 --- a/src/LGraph.ts +++ b/src/LGraph.ts @@ -1472,13 +1472,13 @@ export class LGraph implements LinkNetwork, Serialisable { const links = linkArray.map(x => x.serialize()) if (reroutes.length) { - extra.reroutes = reroutes - // Link parent IDs cannot go in 0.4 schema arrays extra.linkExtensions = linkArray .filter(x => x.parentId !== undefined) .map(x => ({ id: x.id, parentId: x.parentId })) } + + extra.reroutes = reroutes.length ? reroutes : undefined return { last_node_id: state.lastNodeId, last_link_id: state.lastLinkId,