mirror of
https://github.com/ankitects/anki.git
synced 2025-11-06 20:57:13 -05:00
Added: shown check for ease function
This commit is contained in:
parent
9550b127d9
commit
b80dc25999
1 changed files with 10 additions and 2 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
import { CardAnswer, type NextCardDataResponse_NextCardData } from "@generated/anki/scheduler_pb";
|
import { CardAnswer, type NextCardDataResponse_NextCardData } from "@generated/anki/scheduler_pb";
|
||||||
import { nextCardData } from "@generated/backend";
|
import { nextCardData } from "@generated/backend";
|
||||||
import { derived, writable } from "svelte/store";
|
import { derived, get, writable } from "svelte/store";
|
||||||
|
|
||||||
export class ReviewerState {
|
export class ReviewerState {
|
||||||
answerHtml = "";
|
answerHtml = "";
|
||||||
|
|
@ -44,7 +44,11 @@ export class ReviewerState {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case " ": {
|
case " ": {
|
||||||
this.showAnswer();
|
if (!get(this.answerShown)) {
|
||||||
|
this.showAnswer();
|
||||||
|
} else {
|
||||||
|
this.easeButtonPressed(2);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -84,6 +88,10 @@ export class ReviewerState {
|
||||||
}
|
}
|
||||||
|
|
||||||
public easeButtonPressed(rating: number) {
|
public easeButtonPressed(rating: number) {
|
||||||
|
if (!get(this.answerShown)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const states = this.currentCard!.states!;
|
const states = this.currentCard!.states!;
|
||||||
|
|
||||||
const newState = [
|
const newState = [
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue