From 995e668eaad09334e66fc78ef1df3361103a6086 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 12 Apr 2026 11:13:36 +0300 Subject: y1: age current streak against today to drop after missed day --- src/c/fastforge.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/c/fastforge.c b/src/c/fastforge.c index c5efbb0..a302bca 100644 --- a/src/c/fastforge.c +++ b/src/c/fastforge.c @@ -273,7 +273,15 @@ static void recompute_streak_data_from_history(void) { if (longest == 0) { longest = 1; } - streak_data.current_streak = run_length; + + time_t today_day_start = local_day_start(time(NULL)); + time_t last_completion_day = completion_days[completion_day_count - 1]; + if (last_completion_day == today_day_start || + is_next_local_day(last_completion_day, today_day_start)) { + streak_data.current_streak = run_length; + } else { + streak_data.current_streak = 0; + } streak_data.longest_streak = longest; } -- cgit v1.2.3