diff --git a/frontend/src/hooks/useUnreadCounts.ts b/frontend/src/hooks/useUnreadCounts.ts index 0180901..be438c5 100644 --- a/frontend/src/hooks/useUnreadCounts.ts +++ b/frontend/src/hooks/useUnreadCounts.ts @@ -10,9 +10,11 @@ import { import type { Channel, Contact, Conversation, Message, UnreadCounts } from '../types'; import { takePrefetchOrFetch } from '../prefetch'; +type UnreadTrackedConversation = Conversation & { type: 'channel' | 'contact' }; + function isUnreadTrackedConversation( conversation: Conversation | null -): conversation is Extract { +): conversation is UnreadTrackedConversation { return conversation?.type === 'channel' || conversation?.type === 'contact'; }