From bf78f48e65d5756650ece84eb51f04a6dc7f675e Mon Sep 17 00:00:00 2001 From: Ren Tatsumoto Date: Wed, 18 Sep 2024 04:25:34 +0300 Subject: [PATCH] add config property show_last_review --- config.py | 4 ++++ top_toolbar.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config.py b/config.py index b92ee1c..73109af 100644 --- a/config.py +++ b/config.py @@ -112,6 +112,10 @@ def get_zoom_state(self, state: str) -> float: def set_zoom_state(self, state: str, value: float) -> None: self._config.setdefault("zoom_states", {})[state] = value + @property + def show_last_review(self) -> bool: + return bool(self["show_last_review"]) + @property def show_reps_done_today(self) -> bool: return bool(self["show_reps_done_today"]) diff --git a/top_toolbar.py b/top_toolbar.py index f83217b..13100bd 100644 --- a/top_toolbar.py +++ b/top_toolbar.py @@ -89,7 +89,7 @@ def append_link(cls, links: list, toolbar: Toolbar) -> None: @classmethod def update(cls, reviewer: Reviewer, card: Card, ease: int) -> None: """Called after a card was answered.""" - if config["show_last_review"] is False: + if config.show_last_review is False: return label = config.get_label(ease, cls._last_default_ease)