Fix/Leech suspended tooltip (#3992)

* Fix/Leech suspended popup

* extra check

* Fix: None check

* move comment
This commit is contained in:
Luc Mcgrady 2025-05-15 06:14:10 +01:00 committed by GitHub
parent f727934a42
commit f7cdf4eb9e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -551,9 +551,11 @@ class Reviewer:
def after_answer(changes: OpChanges) -> None:
if gui_hooks.reviewer_did_answer_card.count() > 0:
self.card.load()
# v3 scheduler doesn't report this
suspended = self.card is not None and self.card.queue < 0
self._after_answering(ease)
if sched.state_is_leech(answer.new_state):
self.onLeech()
self.onLeech(suspended)
self.state = "transition"
answer_card(parent=self.mw, answer=answer).success(
@ -949,11 +951,10 @@ timerStopped = false;
# Leeches
##########################################################################
def onLeech(self, card: Card | None = None) -> None:
def onLeech(self, suspended: bool = False) -> None:
# for now
s = tr.studying_card_was_a_leech()
# v3 scheduler doesn't report this
if card and card.queue < 0:
if suspended:
s += f" {tr.studying_it_has_been_suspended()}"
tooltip(s)