summaryrefslogtreecommitdiff
path: root/packages/anastasis-webui/src/pages/home/SolveQuestionEntry.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/anastasis-webui/src/pages/home/SolveQuestionEntry.tsx')
-rw-r--r--packages/anastasis-webui/src/pages/home/SolveQuestionEntry.tsx11
1 files changed, 6 insertions, 5 deletions
diff --git a/packages/anastasis-webui/src/pages/home/SolveQuestionEntry.tsx b/packages/anastasis-webui/src/pages/home/SolveQuestionEntry.tsx
index 6393958b3..72dadbe89 100644
--- a/packages/anastasis-webui/src/pages/home/SolveQuestionEntry.tsx
+++ b/packages/anastasis-webui/src/pages/home/SolveQuestionEntry.tsx
@@ -1,14 +1,15 @@
import { h, VNode } from "preact";
import { useState } from "preact/hooks";
+import { useAnastasisContext } from "../../context/anastasis";
import { AnastasisClientFrame, LabeledInput } from "./index";
import { SolveEntryProps } from "./SolveScreen";
-export function SolveQuestionEntry(props: SolveEntryProps): VNode {
+export function SolveQuestionEntry({ challenge, feedback }: SolveEntryProps): VNode {
const [answer, setAnswer] = useState("");
- const { reducer, challenge, feedback } = props;
- const next = (): void => reducer.transition("solve_challenge", {
- answer,
- });
+ const reducer = useAnastasisContext()
+ const next = (): void => {
+ if (reducer) reducer.transition("solve_challenge", { answer })
+ };
return (
<AnastasisClientFrame
title="Recovery: Solve challenge"