v3: added content slugs, fixed real-time updates in client, added @mentions across the app, added new file selector and drop zone
This commit is contained in:
@@ -140,6 +140,18 @@ export function WSProvider({ children, token }: WSProviderProps) {
|
||||
case "dump_updated": {
|
||||
const dump = deserializeDump(msg.dump as RawDump);
|
||||
setLastDumpEvent(dump);
|
||||
// Un-delete if this dump was previously removed from the feed
|
||||
// (e.g. it was made private, and is now public again).
|
||||
setDeletedDumpIds((prev) => {
|
||||
if (!prev.has(dump.id)) return prev;
|
||||
const next = new Set(prev);
|
||||
next.delete(dump.id);
|
||||
return next;
|
||||
});
|
||||
// Add to live feed if not already present (private→public).
|
||||
setRecentDumps((prev) =>
|
||||
prev.some((d) => d.id === dump.id) ? prev : [dump, ...prev]
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -227,6 +239,16 @@ export function WSProvider({ children, token }: WSProviderProps) {
|
||||
break;
|
||||
}
|
||||
|
||||
case "comment_updated": {
|
||||
const comment = deserializeComment(msg.comment as RawComment);
|
||||
setLastCommentEvent({
|
||||
type: "updated",
|
||||
dumpId: comment.dumpId,
|
||||
comment,
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
case "notification_created": {
|
||||
const notification = deserializeNotification(
|
||||
msg.notification as RawNotification,
|
||||
|
||||
Reference in New Issue
Block a user