Merge branch 'chats-media-wut' into 'develop'

Chats: fix null attachment normalization

Closes #1126

See merge request soapbox-pub/soapbox!1845
environments/review-develop-3zknud/deployments/1188
Alex Gleason 2022-10-22 04:21:50 +00:00
commit 86fab1adf6
1 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

@ -25,7 +25,13 @@ export const ChatMessageRecord = ImmutableRecord({
});
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>) => {