Merge branch 'chats-media-wut' into 'develop'
Chats: fix null attachment normalization Closes #1126 See merge request soapbox-pub/soapbox!1845
This commit is contained in:
commit
86fab1adf6
|
@ -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