diff --git a/qt/aqt/mediasrv.py b/qt/aqt/mediasrv.py index c094413a8..a4448bfc6 100644 --- a/qt/aqt/mediasrv.py +++ b/qt/aqt/mediasrv.py @@ -274,6 +274,8 @@ def set_graph_preferences() -> None: def congrats_info() -> bytes: + if not aqt.mw.col.sched._is_finished(): + aqt.mw.taskman.run_on_main(lambda: aqt.mw.moveToState("review")) return aqt.mw.col.congrats_info() diff --git a/ts/congrats/CongratsPage.svelte b/ts/congrats/CongratsPage.svelte index 122d42cb8..1c4702828 100644 --- a/ts/congrats/CongratsPage.svelte +++ b/ts/congrats/CongratsPage.svelte @@ -11,7 +11,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import * as tr from "lib/i18n"; const congrats = tr.schedulingCongratulationsFinished(); - const nextLearnMsg = buildNextLearnMsg(info); + let nextLearnMsg: string; + $: nextLearnMsg = buildNextLearnMsg(info); const today_reviews = tr.schedulingTodayReviewLimitReached(); const today_new = tr.schedulingTodayNewLimitReached(); diff --git a/ts/congrats/index.ts b/ts/congrats/index.ts index 87a109610..75c34d300 100644 --- a/ts/congrats/index.ts +++ b/ts/congrats/index.ts @@ -11,8 +11,13 @@ export async function congrats(target: HTMLDivElement): Promise { checkNightMode(); await setupI18n({ modules: [ModuleName.SCHEDULING] }); const info = await getCongratsInfo(); - new CongratsPage({ + const page = new CongratsPage({ target, props: { info }, }); + setInterval(() => { + getCongratsInfo().then((info) => { + page.$set({ info }); + }); + }, 60000); }