Fix unread badge refresh and reply thread UI

This commit is contained in:
cyph3rasi
2026-03-08 00:31:21 -08:00
parent 98359886df
commit a8f104ee14
4 changed files with 46 additions and 24 deletions
+5 -1
View File
@@ -126,12 +126,16 @@ export default function ChatPage() {
const markAsRead = async (conversationId: string) => {
try {
await fetch('/api/swarm/chat/messages', {
const res = await fetch('/api/swarm/chat/messages', {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ conversationId })
});
if (!res.ok) {
return;
}
setConversations(prev => prev.map(c => c.id === conversationId ? { ...c, unreadCount: 0 } : c));
window.dispatchEvent(new Event('synapsis:chat-updated'));
} catch { }
};