Replies: 1 comment
-
Thanks, we will check it! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
SvelteFlowProvider calls
reset()
on destroy:https://github.com/xyflow/xyflow/blob/reactflow-11.10.3.tgz/packages/svelte/src/lib/components/SvelteFlowProvider/SvelteFlowProvider.svelte#L28
reset()
deletes nodes and edges:https://github.com/xyflow/xyflow/blob/reactflow-11.10.3.tgz/packages/svelte/src/lib/store/index.ts#L338
I subscribe to the nodes and edges stores to persist edits on the backend. When the editor is closed, this
reset()
call triggers a final update that wipes out everything on the backend.I think maybe this is accidental? At the time when the
reset()
call was added to SvelteFlowProvider,reset()
wasn't clearingnodes
andedges
. That was added in d53b7d2. It's part of a bigger PR, so the reason is not clear. It may be better to remove these two lines.nodes
andedges
are user-controlled stores. Let the user decide if they should be reset or not.Beta Was this translation helpful? Give feedback.
All reactions