v3: follows, notifications, invite-only registration, unread markers
This commit is contained in:
@@ -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: () => {},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user