Replace note save call for saveTags cmd

This commit is contained in:
Abdo 2025-05-25 21:24:17 +03:00
parent 8a87e6496c
commit 0a3710e967
2 changed files with 3 additions and 6 deletions

View file

@ -468,12 +468,7 @@ require("anki/ui").loaded.then(() => require("anki/NoteEditor").instances[0].too
self.mw.pm.profile["lastHighlightColor"] = highlightColor
elif cmd.startswith("saveTags"):
(type, tagsJson) = cmd.split(":", 1)
self.note.tags = json.loads(tagsJson)
gui_hooks.editor_did_update_tags(self.note)
if not self.addMode:
self._save_current_note()
elif cmd.startswith("setTagsCollapsed"):
(type, collapsed_string) = cmd.split(":", 1)

View file

@ -283,7 +283,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
function saveTags({ detail }: CustomEvent): void {
tagAmount = detail.tags.filter((tag: string) => tag != "").length;
lastSavedTags = detail.tags;
bridgeCommand(`saveTags:${JSON.stringify(detail.tags)}`);
note!.tags = detail.tags;
bridgeCommand("saveTags");
updateCurrentNote();
}
const fieldSave = new ChangeTimer();