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 { }
};
+1
View File
@@ -69,6 +69,7 @@ export default function NotificationsPage() {
throw new Error('Failed to mark notifications as read');
}
setNotifications(prev => prev.map(n => ({ ...n, readAt: new Date().toISOString() })));
window.dispatchEvent(new Event('synapsis:notifications-updated'));
} catch (err) {
console.error('Failed to mark notifications as read:', err);
}