Fix swapSnapshot using stale app.workflowManager reference

Missed one occurrence of the old API in swapSnapshot() — the workflow
passed to loadGraphData was always undefined, making Swap behave
like Restore (new tab instead of in-place replacement).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-24 20:57:29 +01:00
parent 4cbd8fd0a9
commit 838b3d0b00

View File

@@ -369,7 +369,7 @@ async function swapSnapshot(record) {
return;
}
try {
const workflow = app.workflowManager?.activeWorkflow;
const workflow = app.extensionManager?.workflow?.activeWorkflow;
await app.loadGraphData(record.graphData, true, true, workflow);
lastCapturedHashMap.set(getWorkflowKey(), quickHash(JSON.stringify(record.graphData)));
showToast("Snapshot swapped", "success");