fix(web): normalize channel IDs to lowercase across stores and WS
This commit is contained in:
@@ -61,7 +61,7 @@ function extractIds(payload: UnknownPayload | undefined): { channel_id?: string;
|
||||
? payload.id
|
||||
: null;
|
||||
if (!messageId) return null;
|
||||
if (typeof payload.channel_id === 'string') return { channel_id: payload.channel_id, message_id: messageId };
|
||||
if (typeof payload.channel_id === 'string') return { channel_id: payload.channel_id.toLowerCase(), message_id: messageId };
|
||||
if (typeof payload.conversation_id === 'string') return { conversation_id: payload.conversation_id.toLowerCase(), message_id: messageId };
|
||||
return null;
|
||||
}
|
||||
@@ -150,7 +150,8 @@ export const useWebSocketStore = create<WebSocketState>((set, get) => ({
|
||||
}
|
||||
} else {
|
||||
const msg = payload as unknown as Message;
|
||||
addMessage(msg);
|
||||
const normalizedMsg = { ...msg, channel_id: (msg.channel_id || '').toLowerCase() };
|
||||
addMessage(normalizedMsg);
|
||||
|
||||
// Desktop notification
|
||||
const currentUserId = useAuthStore.getState().user?.id;
|
||||
|
||||
Reference in New Issue
Block a user