|
|
@@ -909,7 +909,13 @@ function WorkflowEditorInner() {
|
|
|
|
|
|
// Autosave, so nobody has to remember to press anything. Edits are grouped -
|
|
|
// see the hook for why one version per keystroke would be no history at all.
|
|
|
- useAutosave(nodes, hasChanges, !isViewingExecution && !!id && !saveMutation.isPending, () => {
|
|
|
+ // The edit token is both arrays: an edge-only edit (reconnect, delete) never
|
|
|
+ // touches `nodes`, so passing `nodes` alone would leave the idle timer
|
|
|
+ // unrestarted for every edge edit after the first in a burst. Memoized so the
|
|
|
+ // token's identity only changes when `nodes` or `edges` themselves do, not on
|
|
|
+ // every unrelated re-render of this page.
|
|
|
+ const autosaveToken = useMemo(() => [nodes, edges], [nodes, edges])
|
|
|
+ useAutosave(autosaveToken, hasChanges, !isViewingExecution && !!id && !saveMutation.isPending, () => {
|
|
|
handleSaveRef.current()
|
|
|
})
|
|
|
|