This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

fix

+2 -3
+2 -3
app/src/app/api/bluesky/stats/route.ts
··· 52 52 53 53 // Calculate flushes per day 54 54 let flushesPerDay = 0; 55 - if (chartData.length > 0) { 55 + if (chartData.length > 0 && totalCount !== null) { 56 56 // Calculate days between first and last flush 57 57 const firstDate = new Date(chartData[0].date); 58 58 const lastDate = new Date(chartData[chartData.length - 1].date); 59 59 const daysDiff = Math.max(1, Math.ceil((lastDate.getTime() - firstDate.getTime()) / (1000 * 60 * 60 * 24))); 60 - flushesPerDay = parseFloat((totalCount / daysDiff).toFixed(1)); 60 + flushesPerDay = parseFloat(((totalCount || 0) / daysDiff).toFixed(1)); 61 61 } 62 62 63 63 // 3. Get top flushers (leaderboard) 64 64 const { data: leaderboardData, error: leaderboardError } = await supabase 65 65 .from('flushing_records') 66 - .select('did, count') 67 66 .select('did') 68 67 .order('created_at', { ascending: false }); 69 68