From 298ec3617bd05bf8d638820138d5b25b6979fd70 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Thu, 24 Oct 2024 13:35:16 +0800 Subject: [PATCH] fix emoji with mention detected as only contains emoji --- src/pages/home/report/comment/TextCommentFragment.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/home/report/comment/TextCommentFragment.tsx b/src/pages/home/report/comment/TextCommentFragment.tsx index 221e91b9ba4a..c9e4bf1529db 100644 --- a/src/pages/home/report/comment/TextCommentFragment.tsx +++ b/src/pages/home/report/comment/TextCommentFragment.tsx @@ -12,6 +12,7 @@ import convertToLTR from '@libs/convertToLTR'; import * as DeviceCapabilities from '@libs/DeviceCapabilities'; import * as EmojiUtils from '@libs/EmojiUtils'; import Performance from '@libs/Performance'; +import * as ReportActionsUtils from '@libs/ReportActionsUtils'; import variables from '@styles/variables'; import CONST from '@src/CONST'; import type {OriginalMessageSource} from '@src/types/onyx/OriginalMessage'; @@ -45,7 +46,8 @@ type TextCommentFragmentProps = { function TextCommentFragment({fragment, styleAsDeleted, styleAsMuted = false, source, style, displayAsGroup, iouMessage = ''}: TextCommentFragmentProps) { const theme = useTheme(); const styles = useThemeStyles(); - const {html = '', text} = fragment ?? {}; + const {html = ''} = fragment ?? {}; + const text = ReportActionsUtils.getTextFromHtml(html); const {translate} = useLocalize(); const {shouldUseNarrowLayout} = useResponsiveLayout();