diff --git a/lib/airdrop/streak.ts b/lib/airdrop/streak.ts index 87202c84..506a23a4 100644 --- a/lib/airdrop/streak.ts +++ b/lib/airdrop/streak.ts @@ -25,14 +25,14 @@ export function getStreakBoost(currentStreak: number): number { /** * Drop one tier after a missed day. Returns the new streak value. - * Per spec: streak snaps down to the current tier's threshold. - * 100+ → 100, 50-99 → 50, 30-49 → 30, 14-29 → 14, 7-13 → 7, 1-6 → 0 + * Per spec: streak drops to the previous tier's threshold. + * 100+ → 50, 50-99 → 30, 30-49 → 14, 14-29 → 7, 7-13 → 0, 1-6 → 0 */ export function dropOneTier(streak: number): number { - // Find the current tier and snap to its threshold + // Find the current tier and drop to the one below it for (let i = TIER_THRESHOLDS.length - 1; i >= 0; i--) { if (streak >= TIER_THRESHOLDS[i]) { - return TIER_THRESHOLDS[i]; + return i > 0 ? TIER_THRESHOLDS[i - 1] : 0; } } return 0; diff --git a/package.json b/package.json index d69bab56..00464f7f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plotlink", - "version": "0.1.29", + "version": "0.1.30", "private": true, "workspaces": [ "packages/*" diff --git a/src/app/api/airdrop/checkin/route.ts b/src/app/api/airdrop/checkin/route.ts index 53825bec..5d7d8a80 100644 --- a/src/app/api/airdrop/checkin/route.ts +++ b/src/app/api/airdrop/checkin/route.ts @@ -102,7 +102,7 @@ export async function POST(req: Request) { // Consecutive day — increment streak newStreak = existing.current_streak + 1; } else { - // Missed 2+ days — snap to current tier threshold + // Missed 2+ days — drop to previous tier threshold newStreak = dropOneTier(existing.current_streak); } } else {