···6262 flushesPerDay = parseFloat(((totalCount || 0) / activeDaysCount).toFixed(1));
6363 }
64646565- // 3. Get top flushers (leaderboard)
6565+ // 3. Get top flushers (leaderboard) - excluding test accounts
6666 const { data: leaderboardData, error: leaderboardError } = await supabase
6767 .from('flushing_records')
6868- .select('did')
6868+ .select('did, handle')
6969 .order('created_at', { ascending: false });
70707171 if (leaderboardError) {
···74747575 // Count flushes by DID
7676 const didCounts = new Map<string, number>();
7777+7878+ // Special count for the plumber
7979+ let plumberFlushCount = 0;
8080+8181+ // List of DIDs to exclude from leaderboard
8282+ const excludedDids = [
8383+ 'did:plc:fouf3svmcxzn6bpiw3lgwz22', // plumber.flushing.im
8484+ 'did:plc:fnhrjbkwjiw6iyxxg2o3rljw' // testing.dame.is
8585+ ];
8686+8787+ // List of handles to exclude from leaderboard (as fallback)
8888+ const excludedHandles = [
8989+ 'plumber.flushing.im',
9090+ 'testing.dame.is'
9191+ ];
9292+7793 leaderboardData?.forEach(entry => {
7878- didCounts.set(entry.did, (didCounts.get(entry.did) || 0) + 1);
9494+ // Check if this is the plumber or test account
9595+ if (entry.did === 'did:plc:fouf3svmcxzn6bpiw3lgwz22' || entry.handle === 'plumber.flushing.im') {
9696+ plumberFlushCount++;
9797+ }
9898+ // Only count towards leaderboard if not an excluded account
9999+ else if (!excludedDids.includes(entry.did) &&
100100+ !(entry.handle && excludedHandles.includes(entry.handle))) {
101101+ didCounts.set(entry.did, (didCounts.get(entry.did) || 0) + 1);
102102+ }
79103 });
8010481105 // Convert to array and sort by count
···89113 totalCount,
90114 flushesPerDay,
91115 chartData: chartData.slice(-30), // Last 30 days
9292- leaderboard
116116+ leaderboard,
117117+ plumberFlushCount
93118 });
94119 } else {
95120 // If no Supabase credentials, return mock data
···97122 totalCount: 42,
98123 flushesPerDay: 3.5,
99124 chartData: generateMockChartData(),
100100- leaderboard: generateMockLeaderboard()
125125+ leaderboard: generateMockLeaderboard(),
126126+ plumberFlushCount: 15
101127 });
102128 }
103129 } catch (error: any) {
+3-24
app/src/app/page.tsx
···176176 setText('is ');
177177 setSuccess('Your flushing status has been updated!');
178178179179- // Create a temporary entry to display immediately
180180- if (result && result.uri && result.cid) {
181181- const tempEntry: FlushingEntry = {
182182- id: `temp-${Date.now()}`, // Create a temporary ID
183183- uri: result.uri,
184184- cid: result.cid,
185185- authorDid: did,
186186- authorHandle: handle || 'unknown',
187187- text: formattedText,
188188- emoji: selectedEmoji,
189189- createdAt: new Date().toISOString()
190190- };
191191-192192- console.log('Adding temporary entry to feed for immediate display:', tempEntry);
193193-194194- // Add the temporary entry to the top of the feed
195195- setEntries(prevEntries => [tempEntry, ...prevEntries]);
196196-197197- // Also mark it as a new entry for animation
198198- setNewEntryIds(new Set([tempEntry.id]));
199199- }
200200-201179 // Close status form after successful submission
202180 setTimeout(() => {
203181 setStatusOpen(false);
204182 }, 2000);
205183206206- // Still refresh the feed after a delay to get the actual database entry
184184+ // Refresh the feed after a delay to get the newly created entry
207185 setTimeout(() => {
186186+ console.log('Refreshing feed to show new entry...');
208187 fetchLatestEntries(true);
209209- }, 3000);
188188+ }, 2500);
210189 } catch (err: any) {
211190 console.error('Failed to update status:', err);
212191 setStatusError(`Failed to update status: ${err.message || 'Unknown error'}`);