shift timebox check to post-answer

- should prevent non-review actions from triggering display
- should prevent next card's audio from playing before diag. dismissed
- the timer hack should no longer be required, as the webview will
have already been loaded

https://forums.ankiweb.net/t/timebox-pop-up-suddenly-appears-when-daily-cutoff-hour-rolls-over-even-when-not-in-the-reviewer/12385
This commit is contained in:
Damien Elmes 2021-08-18 16:25:23 +10:00
parent 546d32cfda
commit 5296bf0a00

View file

@ -208,11 +208,6 @@ class Reviewer:
self._showQuestion()
# Qt seems to get stuck if the timebox modal gets invoked when the
# webview is being loaded
# https://forums.ankiweb.net/t/anki-2-1-45-alpha/10061/96
self.mw.progress.timer(10, self.check_timebox, False)
def _get_next_v1_v2_card(self) -> None:
if self.cardQueue:
# undone/edited cards to show
@ -429,7 +424,8 @@ class Reviewer:
gui_hooks.reviewer_did_answer_card(self, self.card, ease)
self._answeredIds.append(self.card.id)
self.mw.autosave()
self.nextCard()
if not self.check_timebox():
self.nextCard()
# Handlers
############################################################