Fix: Marked undo

This commit is contained in:
Luc Mcgrady 2025-12-01 21:25:11 +00:00
parent cd45436ec2
commit 87152e500a
No known key found for this signature in database
GPG key ID: 4F3D7A0B17CC3D9C

View file

@ -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;
}
}