From 6aebb8993f3ce5fa10c530f79530b8e8175c1484 Mon Sep 17 00:00:00 2001 From: Jon Eugster Date: Wed, 7 Feb 2024 10:34:43 +0100 Subject: [PATCH] update proof from editor --- client/src/components/infoview/info.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/src/components/infoview/info.tsx b/client/src/components/infoview/info.tsx index f542a3c..8a139c7 100644 --- a/client/src/components/infoview/info.tsx +++ b/client/src/components/infoview/info.tsx @@ -254,7 +254,7 @@ function useIsProcessingAt(p: DocumentPosition): boolean { function InfoAux(props: InfoProps) { - const proofContext = React.useContext(ProofContext) + const { setProof } = React.useContext(ProofContext) const config = React.useContext(ConfigContext) @@ -420,6 +420,11 @@ function InfoAux(props: InfoProps) { // hintContext.setHints(state.value.goals.goals[0].hints) // } setDisplayProps({ ...state.value, triggerUpdate }) + + // Update the game's proof state + console.info('updating proof from editor mode.') + setProof(state.value.proof) + } else if (state.state === 'rejected' && state.error !== 'retry') { // The code inside `useAsyncWithTrigger` may only ever reject with a `retry` exception. console.warn('Unreachable code reached with error: ', state.error)