mirror of
https://github.com/ankitects/anki.git
synced 2026-01-07 02:53:54 -05:00
Fix: Marked undo
This commit is contained in:
parent
cd45436ec2
commit
87152e500a
1 changed files with 6 additions and 3 deletions
|
|
@ -219,15 +219,18 @@ export class ReviewerState {
|
|||
this.reviewerAction(ReviewerActionRequest_ReviewerAction.ReplayRecorded);
|
||||
}
|
||||
|
||||
public toggleMarked() {
|
||||
public async toggleMarked() {
|
||||
if (this._cardData && this.currentCard?.card?.noteId) {
|
||||
const noteIds = [this.currentCard.card.noteId];
|
||||
if (this._cardData.marked) {
|
||||
removeNoteTags({ noteIds, tags: "marked" });
|
||||
await removeNoteTags({ noteIds, tags: "marked" });
|
||||
this.undoStatus!.undo = tr.actionsRemoveTag();
|
||||
} else {
|
||||
addNoteTags({ noteIds, tags: "marked" });
|
||||
await addNoteTags({ noteIds, tags: "marked" });
|
||||
this.undoStatus!.undo = tr.actionsUpdateTag();
|
||||
}
|
||||
this.marked.update($marked => !$marked);
|
||||
this._cardData.marked = !this._cardData.marked;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue