Remove the seriouscritter notifications section

Reverts 6537c34 and its syntax fix 4bdfae1. The section only regrouped a
user's own notifications from that account (duplicating them in the list),
and the actorId filter it added to listNotifications was never used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FQFD3mtUWSZpeLbKzkCohh
This commit is contained in:
2026-10-26 11:42:54 -04:00
co-authored by Claude Opus 5.5
parent 4bdfae155a
commit 3a462ee146
2 changed files with 8 additions and 57 deletions
+5 -17
View File
@@ -103,27 +103,15 @@ export async function toNotificationDTOs(rows: Row[]): Promise<NotificationDTO[]
}
/** Newest first, 30 at a time; the cursor is the last one's time. */
export async function listNotifications(
userId: string,
cursor: string | null,
actorId?: string // Added optional actorId filter
): Promise<{
notifications: NotificationDTO[];
unread: number;
nextCursor: string | null;
}> {
export async function listNotifications(userId: string, cursor: string | null) {
const n = schema.notifications;
const before = cursor ? new Date(cursor) : null;
const query = db
const rows = await db
.select()
.from(n)
.where(and(
eq(n.userId, userId),
before && !isNaN(before.getTime()) ? lt(n.createdAt, before) : undefined,
actorId ? eq(n.actorId, actorId) : undefined // Apply actor filter if provided
));
const rows = await query.orderBy(desc(n.createdAt)).limit(31);
.where(and(eq(n.userId, userId), before && !isNaN(before.getTime()) ? lt(n.createdAt, before) : undefined))
.orderBy(desc(n.createdAt))
.limit(31);
const page = rows.slice(0, 30);
return {
notifications: await toNotificationDTOs(page),