Chats: normalize chat messages again so attachments don't break
This commit is contained in:
parent
9802257751
commit
4d9f7fec32
2 changed files with 4 additions and 3 deletions
|
@ -15,13 +15,13 @@ export const ChatMessageRecord = ImmutableRecord({
|
|||
card: null as Card | null,
|
||||
chat_id: '',
|
||||
content: '',
|
||||
created_at: new Date(),
|
||||
created_at: '',
|
||||
emojis: ImmutableList<Emoji>(),
|
||||
id: '',
|
||||
unread: false,
|
||||
|
||||
deleting: false,
|
||||
pending: false,
|
||||
pending: false as boolean | undefined,
|
||||
});
|
||||
|
||||
const normalizeMedia = (status: ImmutableMap<string, any>) => {
|
||||
|
|
|
@ -9,6 +9,7 @@ import compareId from 'soapbox/compare_id';
|
|||
import { useChatContext } from 'soapbox/contexts/chat-context';
|
||||
import { useStatContext } from 'soapbox/contexts/stat-context';
|
||||
import { useApi, useAppDispatch, useAppSelector, useFeatures } from 'soapbox/hooks';
|
||||
import { normalizeChatMessage } from 'soapbox/normalizers';
|
||||
import { flattenPages, PaginatedResult, updatePageItem } from 'soapbox/utils/queries';
|
||||
|
||||
import { queryClient } from './client';
|
||||
|
@ -91,7 +92,7 @@ const useChatMessages = (chat: IChat) => {
|
|||
|
||||
const link = getNextLink(response);
|
||||
const hasMore = !!link;
|
||||
const result = data.sort(reverseOrder);
|
||||
const result = data.sort(reverseOrder).map(normalizeChatMessage);
|
||||
|
||||
return {
|
||||
result,
|
||||
|
|
Loading…
Reference in a new issue