From fa98e0c324b32d2ae2bfc53c7bcd3e6acd42659b Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Thu, 24 Jan 2019 09:04:52 +0100 Subject: [PATCH] Add history-check hack --- AnkiConnect.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/AnkiConnect.py b/AnkiConnect.py index 65bffcf..1627214 100644 --- a/AnkiConnect.py +++ b/AnkiConnect.py @@ -1070,7 +1070,10 @@ class AnkiConnect: def _addCards(self): super()._addCards() - self.reject() + + # if adding was successful it must mean it was added to the history of the window + if len(self.history): + self.reject() def _reject(self): savedMarkClosed = aqt.dialogs.markClosed @@ -1088,7 +1091,10 @@ class AnkiConnect: def addCards(self): super(AddCardsAndClose, self).addCards() - self.reject() + + # if adding was successful it must mean it was added to the history of the window + if len(self.history): + self.reject() def reject(self): savedClose = aqt.dialogs.close