From 24f75e08d9355d472185d44f76e93e44e1670909 Mon Sep 17 00:00:00 2001 From: Andrey Mikhadyuk Date: Fri, 4 Aug 2023 11:05:58 +0400 Subject: [PATCH] fix chat message parsing to use parseStringToTextEditorValue --- src/shared/components/Chat/ChatMessage/ChatMessage.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shared/components/Chat/ChatMessage/ChatMessage.tsx b/src/shared/components/Chat/ChatMessage/ChatMessage.tsx index 196d0b0b79..bf385b76e4 100644 --- a/src/shared/components/Chat/ChatMessage/ChatMessage.tsx +++ b/src/shared/components/Chat/ChatMessage/ChatMessage.tsx @@ -32,6 +32,7 @@ import { FilePreviewVariant, countTextEditorEmojiElements, getFileName, + parseStringToTextEditorValue, } from "@/shared/ui-kit"; import { ChatImageGallery } from "@/shared/ui-kit"; import { StaticLinkType, isRTL } from "@/shared/utils"; @@ -133,7 +134,7 @@ export default function ChatMessage({ } const emojiCount = countTextEditorEmojiElements( - JSON.parse(discussionMessage.text), + parseStringToTextEditorValue(discussionMessage.text), ); const parsedText = await getTextFromTextEditorString({ textEditorString: discussionMessage.text,