mirror of
https://github.com/ankitects/anki.git
synced 2026-01-08 03:23:54 -05:00
Fix: Could answer same card twice if fast enough
This commit is contained in:
parent
71012e7e28
commit
c6a1e1d16c
1 changed files with 3 additions and 4 deletions
|
|
@ -70,6 +70,7 @@ export class ReviewerState {
|
|||
undoStatus: UndoStatus | undefined = undefined;
|
||||
autoAdvanceQuestionTimeout: ReturnType<typeof setTimeout> | undefined;
|
||||
autoAdvanceAnswerTimeout: ReturnType<typeof setTimeout> | undefined;
|
||||
_answerShown = false;
|
||||
|
||||
iframe: HTMLIFrameElement | undefined = undefined;
|
||||
|
||||
|
|
@ -414,6 +415,7 @@ export class ReviewerState {
|
|||
this.setUndo(tr.actionsAnswerCard());
|
||||
}
|
||||
|
||||
this._answerShown = false;
|
||||
const resp = await nextCardData({
|
||||
answer: answer || undefined,
|
||||
});
|
||||
|
|
@ -461,16 +463,13 @@ export class ReviewerState {
|
|||
|
||||
public async showAnswer() {
|
||||
this.answerShown.set(true);
|
||||
this._answerShown = true;
|
||||
this.maybeAutoPlayAudio(this._cardData!.answerAvTags);
|
||||
this.answerMs = Date.now();
|
||||
this.updateHtml(await this.showTypedAnswer(this._cardData?.back || ""));
|
||||
this.updateAutoAdvanceAnswer();
|
||||
}
|
||||
|
||||
get _answerShown() {
|
||||
return get(this.answerShown);
|
||||
}
|
||||
|
||||
public easeButtonPressed(rating: number) {
|
||||
if (!this._answerShown) {
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in a new issue