Chats: fix null attachment normalization
This commit is contained in:
parent
e9578a7c9a
commit
427b8f9175
|
@ -25,7 +25,13 @@ export const ChatMessageRecord = ImmutableRecord({
|
||||||
});
|
});
|
||||||
|
|
||||||
const normalizeMedia = (status: ImmutableMap<string, any>) => {
|
const normalizeMedia = (status: ImmutableMap<string, any>) => {
|
||||||
return status.update('attachment', null, normalizeAttachment);
|
const attachment = status.get('attachment');
|
||||||
|
|
||||||
|
if (attachment) {
|
||||||
|
return status.set('attachment', normalizeAttachment(attachment));
|
||||||
|
} else {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const normalizeChatMessage = (chatMessage: Record<string, any>) => {
|
export const normalizeChatMessage = (chatMessage: Record<string, any>) => {
|
||||||
|
|
Loading…
Reference in New Issue