diff --git a/src/libs/isReportMessageAttachment.ts b/src/libs/isReportMessageAttachment.ts index 3f9e9d2de201..98aebefe947d 100644 --- a/src/libs/isReportMessageAttachment.ts +++ b/src/libs/isReportMessageAttachment.ts @@ -13,14 +13,15 @@ type IsReportMessageAttachmentParams = { * @param reportActionMessage report action's message as text, html and translationKey */ export default function isReportMessageAttachment({text, html, translationKey}: IsReportMessageAttachmentParams): boolean { - if (translationKey) { - return translationKey === CONST.TRANSLATION_KEYS.ATTACHMENT; - } if (!text || !html) { return false; } + if (translationKey && text === CONST.ATTACHMENT_MESSAGE_TEXT) { + return translationKey === CONST.TRANSLATION_KEYS.ATTACHMENT; + } + const regex = new RegExp(` ${CONST.ATTACHMENT_SOURCE_ATTRIBUTE}="(.*)"`, 'i'); return text === CONST.ATTACHMENT_MESSAGE_TEXT && (!!html.match(regex) || html === CONST.ATTACHMENT_UPLOADING_MESSAGE_HTML); }