v3: follows, notifications, invite-only registration, unread markers

This commit is contained in:
khannurien
2026-03-21 18:42:47 +00:00
parent 7c098e7c4c
commit 608c6bc6a8
55 changed files with 4743 additions and 884 deletions

View File

@@ -1,5 +1,11 @@
import { createContext } from "react";
import type { Comment, Dump, OnlineUser, Playlist } from "../model.ts";
import type {
Comment,
Dump,
Notification,
OnlineUser,
Playlist,
} from "../model.ts";
export interface VoteEvent {
dumpId: string;
@@ -33,8 +39,12 @@ export interface WSContextValue {
lastPlaylistEvent: PlaylistEvent | null;
deletedPlaylistIds: Set<string>;
lastCommentEvent: CommentEvent | null;
unreadNotificationCount: number;
lastNotification: Notification | null;
castVote: (dumpId: string) => void;
removeVote: (dumpId: string) => void;
injectDump: (dump: Dump) => void;
clearUnreadNotifications: () => void;
}
export const WSContext = createContext<WSContextValue>({
@@ -48,6 +58,10 @@ export const WSContext = createContext<WSContextValue>({
lastPlaylistEvent: null,
deletedPlaylistIds: new Set(),
lastCommentEvent: null,
unreadNotificationCount: 0,
lastNotification: null,
castVote: () => {},
removeVote: () => {},
injectDump: () => {},
clearUnreadNotifications: () => {},
});