fix: prevent single-day streaks from being shown

A streak requires at least 2 consecutive days. Return 0 when the
count is less than 2 so the streak counter is not displayed after
completing only today's puzzle.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
George Powell
2026-02-26 14:57:44 -05:00
parent 3ee7331510
commit 03429b17cc

View File

@@ -32,5 +32,5 @@ export const GET: RequestHandler = async ({ url }) => {
cursor.setDate(cursor.getDate() - 1); cursor.setDate(cursor.getDate() - 1);
} }
return json({ streak }); return json({ streak: streak < 2 ? 0 : streak });
}; };