From 4e3d90573298e13478aa29cb713ef0e0ec37f62b Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Wed, 3 Jan 2024 22:00:11 +0100 Subject: [PATCH] fix: deck chooser causes error --- src/__init__.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/__init__.py b/src/__init__.py index ce4434d..d06e0e7 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -60,11 +60,13 @@ def deck_change(id): "before", ) else: - aqt.deckchooser.DeckChooser.choose_deck = anki.hooks.wrap( - aqt.deckchooser.DeckChooser.choose_deck, - lambda deckchooser: deck_change(deckchooser.selected_deck_id), - "after", - ) + save_func = aqt.deckchooser.DeckChooser.choose_deck + + def on_deck_change(deckchooser): + save_func(deckchooser) + deck_change(deckchooser.selected_deck_id), + + aqt.deckchooser.DeckChooser.choose_deck = on_deck_change ### MODEL CHANGE def notetype_change(id):