From d5b44654b0ab5fc59bd6833226bd1c2bbffe5ae4 Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Mon, 21 Jun 2021 15:48:22 +0200 Subject: [PATCH] Call update_notetype_legacy after toggling sticky --- qt/aqt/editor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qt/aqt/editor.py b/qt/aqt/editor.py index b07137d69..f48f3c83b 100644 --- a/qt/aqt/editor.py +++ b/qt/aqt/editor.py @@ -32,6 +32,7 @@ from anki.utils import checksum, isLin, isWin, namedtmp from aqt import AnkiQt, colors, gui_hooks from aqt.operations import QueryOp from aqt.operations.note import update_note +from aqt.operations.notetype import update_notetype_legacy from aqt.qt import * from aqt.sound import av_player from aqt.theme import theme_manager @@ -393,10 +394,13 @@ $editorToolbar.then(({{ toolbar }}) => toolbar.appendGroup({{ (type, num) = cmd.split(":", 1) ord = int(num) - fld = self.note.model()["flds"][ord] + model = self.note.model() + fld = model["flds"][ord] new_state = not fld["sticky"] fld["sticky"] = new_state + update_notetype_legacy(parent=self.mw, notetype=model).run_in_background() + return new_state elif cmd in self._links: