Fix chat filter typescript error

This commit is contained in:
2026-09-29 21:54:54 +03:30
parent 5bb8e68521
commit 58e89246d9
+10 -11
View File
@@ -927,17 +927,16 @@ export function useOrgChat() {
rememberHidden(roomId, [...hiddenSet]);
const myId = session.chatUserId;
const normalized = (list
.map((item: Record<string, unknown>) => normalizeIncoming(item, roomId))
.filter((m): m is ChatMessage => Boolean(m) && !hiddenSet.has(m!.id)) as ChatMessage[]).map(
(m) => {
if (m.senderId !== myId) return m;
return {
...m,
delivery: (m.readAt ? 'read' : 'sent') as ChatDelivery,
};
},
);
const normalized: ChatMessage[] = [];
for (const item of list as Record<string, unknown>[]) {
const m = normalizeIncoming(item, roomId);
if (!m || hiddenSet.has(m.id)) continue;
normalized.push(
m.senderId === myId
? { ...m, delivery: (m.readAt ? 'read' : 'sent') as ChatDelivery }
: m,
);
}
messages.value = sortAsc(normalized);
sendRead(roomId);
} finally {