mirror of
https://github.com/ankitects/anki.git
synced 2026-01-07 02:53:54 -05:00
Added: Bury shortcut
This commit is contained in:
parent
40d7ce88aa
commit
f5c4b02609
2 changed files with 23 additions and 1 deletions
|
|
@ -779,6 +779,7 @@ exposed_backend_list = [
|
|||
"get_optimal_retention_parameters",
|
||||
"simulate_fsrs_review",
|
||||
"simulate_fsrs_workload",
|
||||
"bury_or_suspend_cards",
|
||||
# DeckConfigService
|
||||
"get_ignored_before_count",
|
||||
"get_retention_workload",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,12 @@
|
|||
// Copyright: Ankitects Pty Ltd and contributors
|
||||
// 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 {
|
||||
BuryOrSuspendCardsRequest_Mode,
|
||||
CardAnswer,
|
||||
type NextCardDataResponse_NextCardData,
|
||||
} from "@generated/anki/scheduler_pb";
|
||||
import {
|
||||
buryOrSuspendCards,
|
||||
compareAnswer,
|
||||
displayEditMenu,
|
||||
getConfigJson,
|
||||
|
|
@ -95,6 +100,17 @@ export class ReviewerState {
|
|||
displayEditMenu({ cid: this.currentCard?.card?.id });
|
||||
}
|
||||
|
||||
public buryCurrentCard() {
|
||||
if (this.currentCard?.card?.id) {
|
||||
buryOrSuspendCards({
|
||||
cardIds: [this.currentCard?.card?.id],
|
||||
noteIds: [],
|
||||
mode: BuryOrSuspendCardsRequest_Mode.BURY_USER,
|
||||
});
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
async handleKeyPress(key: string, ctrl: boolean, shift: boolean) {
|
||||
key = key.toLowerCase();
|
||||
switch (key) {
|
||||
|
|
@ -136,6 +152,11 @@ export class ReviewerState {
|
|||
}
|
||||
case "e": {
|
||||
this.displayEditMenu();
|
||||
break;
|
||||
}
|
||||
case "-": {
|
||||
this.buryCurrentCard();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue