Fix chat filter typescript error
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user