Added: Delete current note

This commit is contained in:
Luc Mcgrady 2025-11-12 17:28:33 +00:00
parent 5523482121
commit d549112a6b
No known key found for this signature in database
GPG key ID: 4F3D7A0B17CC3D9C
3 changed files with 11 additions and 1 deletions

View file

@ -765,6 +765,7 @@ exposed_backend_list = [
# NotesService
"get_field_names",
"get_note",
"remove_notes",
# NotetypesService
"get_notetype_names",
"get_change_notetype_info",

View file

@ -70,7 +70,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
{
name: tr.studyingDeleteNote(),
shortcut: /* isMac ? "Ctrl+Backspace" :*/ "Ctrl+Delete",
onClick: todo,
onClick: state.deleteCurrentNote.bind(state),
},
"hr",

View file

@ -13,6 +13,7 @@ import {
openReviewerMenu,
playAvtags,
redo,
removeNotes,
setConfigJson,
undo,
} from "@generated/backend";
@ -150,6 +151,14 @@ export class ReviewerState {
}
}
public async deleteCurrentNote() {
if (this.currentCard?.card?.noteId) {
const op = await removeNotes({ noteIds: [this.currentCard.card.noteId], cardIds: [] });
this.showTooltip(tr.browsingCardsDeleted({ count: op.count }));
this.refresh();
}
}
async handleKeyPress(key: string, ctrl: boolean, shift: boolean) {
key = key.toLowerCase();
switch (key) {