manifoldmarkets / manifold

Manifold Markets: A market for every question
https://manifold.markets
MIT License
396 stars 147 forks source link

Implement live updates for comment likes via websockets #2694

Closed mentatbot[bot] closed 6 days ago

mentatbot[bot] commented 1 week ago

This PR addresses issue #2693 by enabling live updates for comment likes using websockets. The following changes were made:

  1. Backend Changes:

    • Updated reaction.ts to broadcast the updated comment when a like is added or removed.
    • Added a new function broadcastCommentUpdate in server.ts to handle broadcasting comment updates.
  2. Frontend Changes:

    • Modified use-api-subscription.ts to include a new onCommentUpdate callback for handling comment update messages.
    • Updated use-likes.ts to subscribe to comment updates and update the likes count in real-time.

These changes ensure that when a user likes a comment, the updated like count is broadcasted and reflected on all clients in real-time.

Closes #2693

vercel[bot] commented 1 week ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dev ❌ Failed (Inspect) Jun 30, 2024 7:04am
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 30, 2024 7:04am
prod ❌ Failed (Inspect) Jun 30, 2024 7:04am