add incorrect items to the end of the queue
This commit is contained in:
parent
f87230596d
commit
492215d17c
2 changed files with 6 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -24,3 +24,4 @@ dist-ssr
|
|||
*.sw?
|
||||
|
||||
houhou.db
|
||||
src/data/kanadata.json
|
|
@ -83,6 +83,9 @@ export function Component() {
|
|||
// Check the answer
|
||||
if (!possibleAnswers.has(currentAnswer)) {
|
||||
setIsIncorrect(true);
|
||||
|
||||
const lastItem = reviewQueue[reviewQueue.length - 1];
|
||||
if (!_.isEqual(lastItem, nextItem)) setReviewQueue([...reviewQueue, nextItem]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -90,7 +93,7 @@ export function Component() {
|
|||
setAnyProgress(true);
|
||||
setIsIncorrect(false);
|
||||
setCurrentAnswer("");
|
||||
const [_, ...rest] = reviewQueue;
|
||||
const [_currentItem, ...rest] = reviewQueue;
|
||||
setReviewQueue(rest);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue