alpha
Login
or
Join now
atpota.to
/
flushes.app
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
fix
author
damedotblog
date
1 year ago
(Mar 8, 2025, 7:50 PM -0500)
commit
f19f556e
f19f556e5f5c13b14d53e4e36faf9f94b5411a17
parent
13efc3e5
13efc3e521b6acd048497e683f349a17ec1c072a
+2
-3
1 changed file
Expand all
Collapse all
Unified
Split
app
src
app
api
bluesky
stats
route.ts
+2
-3
app/src/app/api/bluesky/stats/route.ts
Reviewed
···
52
52
53
53
// Calculate flushes per day
54
54
let flushesPerDay = 0;
55
55
-
if (chartData.length > 0) {
55
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
60
-
flushesPerDay = parseFloat((totalCount / daysDiff).toFixed(1));
60
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
66
-
.select('did, count')
67
66
.select('did')
68
67
.order('created_at', { ascending: false });
69
68