mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Fix/Leech suspended tooltip (#3992)
* Fix/Leech suspended popup * extra check * Fix: None check * move comment
This commit is contained in:
parent
f727934a42
commit
f7cdf4eb9e
1 changed files with 5 additions and 4 deletions
|
@ -551,9 +551,11 @@ class Reviewer:
|
||||||
def after_answer(changes: OpChanges) -> None:
|
def after_answer(changes: OpChanges) -> None:
|
||||||
if gui_hooks.reviewer_did_answer_card.count() > 0:
|
if gui_hooks.reviewer_did_answer_card.count() > 0:
|
||||||
self.card.load()
|
self.card.load()
|
||||||
|
# v3 scheduler doesn't report this
|
||||||
|
suspended = self.card is not None and self.card.queue < 0
|
||||||
self._after_answering(ease)
|
self._after_answering(ease)
|
||||||
if sched.state_is_leech(answer.new_state):
|
if sched.state_is_leech(answer.new_state):
|
||||||
self.onLeech()
|
self.onLeech(suspended)
|
||||||
|
|
||||||
self.state = "transition"
|
self.state = "transition"
|
||||||
answer_card(parent=self.mw, answer=answer).success(
|
answer_card(parent=self.mw, answer=answer).success(
|
||||||
|
@ -949,11 +951,10 @@ timerStopped = false;
|
||||||
# Leeches
|
# Leeches
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
def onLeech(self, card: Card | None = None) -> None:
|
def onLeech(self, suspended: bool = False) -> None:
|
||||||
# for now
|
# for now
|
||||||
s = tr.studying_card_was_a_leech()
|
s = tr.studying_card_was_a_leech()
|
||||||
# v3 scheduler doesn't report this
|
if suspended:
|
||||||
if card and card.queue < 0:
|
|
||||||
s += f" {tr.studying_it_has_been_suspended()}"
|
s += f" {tr.studying_it_has_been_suspended()}"
|
||||||
tooltip(s)
|
tooltip(s)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue