Skip to content

Commit

Permalink
[Bugfix] Fix round reset for prescription mode
Browse files Browse the repository at this point in the history
  • Loading branch information
slavoyar committed Oct 25, 2024
1 parent 321123f commit 5914e01
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frontend/src/widgets/prescription-practice/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export const PrescriptionPractice = ({ card, onNext }: Props) => {
rounds = Array(HINT_ROUNDS + ROUNDS)
.fill({ withOutline: false })
.map((_, index) => ({ withOutline: index < HINT_ROUNDS }));
}, []);
setRound(0);
}, [card]);

return (
<>
Expand All @@ -36,7 +37,7 @@ export const PrescriptionPractice = ({ card, onNext }: Props) => {
translation={card.word.translation}
transcription={card.word.transcription}
showOutline={item.withOutline}
isNextDisabled={round !== rounds.length - 1}
isNextDisabled={index !== rounds.length - 1}
updateStats={false}
onNext={() => {
if (index === rounds.length - 1) {
Expand Down

0 comments on commit 5914e01

Please sign in to comment.