v3: code quality pass, various bug fixes

This commit is contained in:
khannurien
2026-03-23 07:47:49 +00:00
parent d94a319d96
commit fbbbb43258
44 changed files with 1060 additions and 698 deletions

View File

@@ -5,6 +5,7 @@ import type {
Notification,
OnlineUser,
Playlist,
PublicUser,
} from "../model.ts";
export interface VoteEvent {
@@ -28,6 +29,10 @@ export interface CommentEvent {
commentId?: string;
}
export interface UserEvent {
user: PublicUser;
}
export interface WSContextValue {
onlineUsers: OnlineUser[];
voteCounts: Record<string, number>;
@@ -39,6 +44,7 @@ export interface WSContextValue {
lastPlaylistEvent: PlaylistEvent | null;
deletedPlaylistIds: Set<string>;
lastCommentEvent: CommentEvent | null;
lastUserEvent: UserEvent | null;
unreadNotificationCount: number;
lastNotification: Notification | null;
castVote: (dumpId: string) => void;
@@ -58,6 +64,7 @@ export const WSContext = createContext<WSContextValue>({
lastPlaylistEvent: null,
deletedPlaylistIds: new Set(),
lastCommentEvent: null,
lastUserEvent: null,
unreadNotificationCount: 0,
lastNotification: null,
castVote: () => {},