mirror of
https://github.com/ankitects/anki.git
synced 2025-11-08 13:47:13 -05:00
Added: web.eval based refresh
This commit is contained in:
parent
46ce7d5b94
commit
2a92213118
2 changed files with 11 additions and 0 deletions
|
|
@ -1261,6 +1261,15 @@ class SvelteReviewer(Reviewer):
|
||||||
|
|
||||||
return [but(ease, label) for ease, label in self._answerButtonList()] # type: ignore
|
return [but(ease, label) for ease, label in self._answerButtonList()] # type: ignore
|
||||||
|
|
||||||
|
def refresh_if_needed(self):
|
||||||
|
if self._refresh_needed:
|
||||||
|
self.mw.fade_in_webview()
|
||||||
|
self.web.eval("if (anki) {anki.changeReceived()}")
|
||||||
|
self._refresh_needed = None
|
||||||
|
|
||||||
|
def show(self) -> None:
|
||||||
|
self._initWeb()
|
||||||
|
|
||||||
def _remaining(self) -> str:
|
def _remaining(self) -> str:
|
||||||
if not self.mw.col.conf["dueCounts"]:
|
if not self.mw.col.conf["dueCounts"]:
|
||||||
return ""
|
return ""
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
const state = new ReviewerState();
|
const state = new ReviewerState();
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
updateNightMode();
|
updateNightMode();
|
||||||
|
globalThis.anki ??= {};
|
||||||
|
globalThis.anki.changeReceived = () => state.showQuestion(null);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue