v1 review pass: fixed some minor bugs

This commit is contained in:
khannurien
2026-03-16 11:08:39 +00:00
parent e88fed4e98
commit 867e64cb5b
37 changed files with 1228 additions and 400 deletions

View File

@@ -1,12 +1,19 @@
import { createContext } from "react";
import type { Dump, OnlineUser } from "../model.ts";
export interface VoteEvent {
dumpId: string;
voterId: string;
action: "cast" | "remove";
}
export interface WSContextValue {
onlineUsers: OnlineUser[];
voteCounts: Record<string, number>;
myVotes: Set<string>;
recentDumps: Dump[];
deletedDumpIds: Set<string>;
lastVoteEvent: VoteEvent | null;
castVote: (dumpId: string) => void;
removeVote: (dumpId: string) => void;
}
@@ -17,6 +24,7 @@ export const WSContext = createContext<WSContextValue>({
myVotes: new Set(),
recentDumps: [],
deletedDumpIds: new Set(),
lastVoteEvent: null,
castVote: () => {},
removeVote: () => {},
});