From 271bc271f7e61a87223ef6dbe6436bbb6f8c217a Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 29 Aug 2022 16:35:41 -0500 Subject: [PATCH] Chats: normalize chat messages from the API --- app/soapbox/queries/chats.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/soapbox/queries/chats.ts b/app/soapbox/queries/chats.ts index a6a340f5c..ac2b352f8 100644 --- a/app/soapbox/queries/chats.ts +++ b/app/soapbox/queries/chats.ts @@ -5,6 +5,7 @@ import snackbar from 'soapbox/actions/snackbar'; import compareId from 'soapbox/compare_id'; import { useChatContext } from 'soapbox/contexts/chat-context'; import { useApi, useAppDispatch } from 'soapbox/hooks'; +import { normalizeChatMessage } from 'soapbox/normalizers'; import { queryClient } from './client'; @@ -51,7 +52,7 @@ const useChatMessages = (chatId: string) => { }); const hasMore = !!headers.link; - const result = data.sort(reverseOrder); + const result = data.sort(reverseOrder).map(normalizeChatMessage); const nextMaxId = result[0]?.id; return {