mirror of
https://github.com/ankitects/anki.git
synced 2026-01-11 04:53:55 -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;
|
undoStatus: UndoStatus | undefined = undefined;
|
||||||
autoAdvanceQuestionTimeout: ReturnType<typeof setTimeout> | undefined;
|
autoAdvanceQuestionTimeout: ReturnType<typeof setTimeout> | undefined;
|
||||||
autoAdvanceAnswerTimeout: ReturnType<typeof setTimeout> | undefined;
|
autoAdvanceAnswerTimeout: ReturnType<typeof setTimeout> | undefined;
|
||||||
|
_answerShown = false;
|
||||||
|
|
||||||
iframe: HTMLIFrameElement | undefined = undefined;
|
iframe: HTMLIFrameElement | undefined = undefined;
|
||||||
|
|
||||||
|
|
@ -414,6 +415,7 @@ export class ReviewerState {
|
||||||
this.setUndo(tr.actionsAnswerCard());
|
this.setUndo(tr.actionsAnswerCard());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._answerShown = false;
|
||||||
const resp = await nextCardData({
|
const resp = await nextCardData({
|
||||||
answer: answer || undefined,
|
answer: answer || undefined,
|
||||||
});
|
});
|
||||||
|
|
@ -461,16 +463,13 @@ export class ReviewerState {
|
||||||
|
|
||||||
public async showAnswer() {
|
public async showAnswer() {
|
||||||
this.answerShown.set(true);
|
this.answerShown.set(true);
|
||||||
|
this._answerShown = true;
|
||||||
this.maybeAutoPlayAudio(this._cardData!.answerAvTags);
|
this.maybeAutoPlayAudio(this._cardData!.answerAvTags);
|
||||||
this.answerMs = Date.now();
|
this.answerMs = Date.now();
|
||||||
this.updateHtml(await this.showTypedAnswer(this._cardData?.back || ""));
|
this.updateHtml(await this.showTypedAnswer(this._cardData?.back || ""));
|
||||||
this.updateAutoAdvanceAnswer();
|
this.updateAutoAdvanceAnswer();
|
||||||
}
|
}
|
||||||
|
|
||||||
get _answerShown() {
|
|
||||||
return get(this.answerShown);
|
|
||||||
}
|
|
||||||
|
|
||||||
public easeButtonPressed(rating: number) {
|
public easeButtonPressed(rating: number) {
|
||||||
if (!this._answerShown) {
|
if (!this._answerShown) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue