Open Kroro1208 opened 4 months ago
if(true || !challenge){ // trueを入れて確認してみると、画面が表示されてリダイレクトもされるのでchallengeの値を確認する必要がある
return (
<>
{finishAudio}
<Confetti width={width} height={height} recycle={false} numberOfPieces={500} tweenDuration={10000}/>
<div className="flex flex-col gap-y-4 lg:gap-y-8 max-w-lg mx-auto text-center items-center justify-center h-full">
<Image src="/star.gif" alt="finish" className="hidden lg:block" height={100} width={100} />
<Image src="/star.gif" alt="finish" className="block lg:hidden" height={50} width={50} />
<h1 className="text-xl lg:text-3xl font-bold text-neutral-700">
よくできました!<br/>このレッスンは終了です!
</h1>
<div className="flex items-center gap-x-4 w-full">
<ResultCard variant="points" value={challenges.length * 10}/>
<ResultCard variant="hearts" value={hearts}/>
</div>
</div>
<Footer lessonId={lessonId} status="completed" onCheck={() => router.push("/learn")}/>
</>
);
}
true
になっていないawait db.insert(challengeProgress).values({
challengeId,
userId,
completed: true
});
DBでも正解した問題は全てcompleted: true
になっていることが確認できる
本来なら一度、/learnページへredirectして、レッスンボタンを押してから次のレッスンに進む