풀이가 끝나고 나서, 첫 화면으로 돌아온 뒤 다시 시작할 때 결과화면이 나오는 오류 수정

This commit is contained in:
2026-05-26 19:02:10 +09:00
parent 98dd5d319c
commit 8efe618a31
2 changed files with 3 additions and 2 deletions
+2
View File
@@ -14,6 +14,7 @@ export default function StartControls() {
(state) => state.selectedProblemCount, (state) => state.selectedProblemCount,
); );
const setProblemCount = useGameStore((state) => state.setProblemCount); const setProblemCount = useGameStore((state) => state.setProblemCount);
const initSession = useGameStore((state) => state.initSession);
useEffect(() => { useEffect(() => {
startLinkRef.current?.focus(); startLinkRef.current?.focus();
@@ -25,6 +26,7 @@ export default function StartControls() {
<Link <Link
ref={startLinkRef} ref={startLinkRef}
href={`/play?count=${selectedProblemCount}`} href={`/play?count=${selectedProblemCount}`}
onClick={() => initSession(selectedProblemCount)}
className="inline-flex h-12 items-center justify-center rounded-md bg-emerald-700 px-6 text-base font-semibold text-white transition hover:bg-emerald-800 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2" className="inline-flex h-12 items-center justify-center rounded-md bg-emerald-700 px-6 text-base font-semibold text-white transition hover:bg-emerald-800 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2"
> >
+1 -2
View File
@@ -20,8 +20,7 @@ export default function Home() {
<StartControls /> <StartControls />
<div className="border-l-4 border-emerald-700 pl-4 text-sm leading-6 text-slate-600"> <div className="border-l-4 border-emerald-700 pl-4 text-sm leading-6 text-slate-600">
<p> .</p> <p> , [ ] .</p>
<p> .</p>
</div> </div>
</section> </section>
</main> </main>