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

@@ -43,7 +43,14 @@ export function Dump() {
const [comments, setComments] = useState<Comment[]>([]);
const { user, token } = useAuth();
const { voteCounts, myVotes, castVote, removeVote, lastDumpEvent, lastCommentEvent } = useWS();
const {
voteCounts,
myVotes,
castVote,
removeVote,
lastDumpEvent,
lastCommentEvent,
} = useWS();
useEffect(() => {
if (!selectedDump) return;
@@ -114,7 +121,9 @@ export function Dump() {
if (!lastCommentEvent || lastCommentEvent.dumpId !== selectedDump) return;
if (lastCommentEvent.type === "created" && lastCommentEvent.comment) {
setComments((prev) => {
if (prev.some((c) => c.id === lastCommentEvent.comment!.id)) return prev;
if (prev.some((c) => c.id === lastCommentEvent.comment!.id)) {
return prev;
}
return [...prev, lastCommentEvent.comment!];
});
} else if (