diff --git a/components/scenario-form.jsx b/components/scenario-form.jsx index 776b77f..eddc1d0 100644 --- a/components/scenario-form.jsx +++ b/components/scenario-form.jsx @@ -365,7 +365,7 @@ export default function ScenarioForm() { doneInProgressRef.current = true; try { - const result = await executeEpisodeDone({ + const doneResult = await executeEpisodeDone({ resultSituationGraph: result?.situationGraph, targetNodeId, focusedContributions: focusedContributions ?? [], @@ -381,8 +381,8 @@ export default function ScenarioForm() { }); /* CU synthesis — install only on success */ - if (result?.synthesisResult?.ok && result.synthesisResult.data?.currentUnderstanding) { - setCurrentUnderstanding(result.synthesisResult.data.currentUnderstanding); + if (doneResult?.synthesisResult?.ok && doneResult.synthesisResult.data?.currentUnderstanding) { + setCurrentUnderstanding(doneResult.synthesisResult.data.currentUnderstanding); } /* On synthesis failure: KEEP nextGraph, KEEP Findings, KEEP existing CU. Do NOT rollback. */