From 0a3710e967ea8193d76ec53d97720c44bc7a2050 Mon Sep 17 00:00:00 2001 From: Abdo Date: Sun, 25 May 2025 21:24:17 +0300 Subject: [PATCH] Replace note save call for saveTags cmd --- qt/aqt/editor.py | 5 ----- ts/routes/editor/NoteEditor.svelte | 4 +++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/qt/aqt/editor.py b/qt/aqt/editor.py index 39adfbe14..595059b57 100644 --- a/qt/aqt/editor.py +++ b/qt/aqt/editor.py @@ -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) diff --git a/ts/routes/editor/NoteEditor.svelte b/ts/routes/editor/NoteEditor.svelte index 4000a0d93..ff179e70c 100644 --- a/ts/routes/editor/NoteEditor.svelte +++ b/ts/routes/editor/NoteEditor.svelte @@ -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();