diff --git a/rslib/src/scheduler/congrats.rs b/rslib/src/scheduler/congrats.rs index 63f7a17cd..aea2b3cab 100644 --- a/rslib/src/scheduler/congrats.rs +++ b/rslib/src/scheduler/congrats.rs @@ -21,10 +21,13 @@ impl Collection { let info = self.storage.congrats_info(&deck, today)?; let is_filtered_deck = deck.is_filtered(); let deck_description = deck.rendered_description(); - let secs_until_next_learn = ((info.next_learn_due as i64) - - self.learn_ahead_secs() as i64 - - TimestampSecs::now().0) - .max(0) as u32; + let secs_until_next_learn = if info.next_learn_due == 0 { + // signal to the frontend that no learning cards are due later + 86_400 + } else { + ((info.next_learn_due as i64) - self.learn_ahead_secs() as i64 - TimestampSecs::now().0) + .max(60) as u32 + }; Ok(pb::CongratsInfoResponse { learn_remaining: info.learn_count, review_remaining: info.review_remaining, @@ -56,7 +59,7 @@ mod test { have_sched_buried: false, have_user_buried: false, is_filtered_deck: false, - secs_until_next_learn: 0, + secs_until_next_learn: 86_400, bridge_commands_supported: true, deck_description: "".to_string() } diff --git a/ts/congrats/lib.ts b/ts/congrats/lib.ts index 9ab67c171..48c83dd70 100644 --- a/ts/congrats/lib.ts +++ b/ts/congrats/lib.ts @@ -15,8 +15,8 @@ export async function getCongratsInfo(): Promise export function buildNextLearnMsg(info: Scheduler.CongratsInfoResponse): string { const secsUntil = info.secsUntilNextLearn; - // next learning card not due (/ until tomorrow)? - if (secsUntil == 0 || secsUntil > 86_400) { + // next learning card not due today? + if (secsUntil >= 86_400) { return ""; }