diff --git a/src/lib/msgUtils.js b/src/lib/msgUtils.js index 1de8f70..fa200dd 100644 --- a/src/lib/msgUtils.js +++ b/src/lib/msgUtils.js @@ -96,7 +96,7 @@ export const sentMsgTypeMapped = { conversationid: msg.id.split('.')[0], type: 'text', title: msg.template_origin.components.header?.[0]?.text || '', - text: templateDataMapped?.body?.text || '', // msg.template_origin.components.body?.[0]?.text || '', + text: autoLinkText( templateDataMapped?.body?.text || ''), // msg.template_origin.components.body?.[0]?.text || '', }; }, }, @@ -247,7 +247,7 @@ export const whatsappMsgTypeMapped = { type: 'text', data: (msg) => { const templateDataMapped = msg.template?.components ? msg.template.components.reduce((r, v) => ({...r, [v.type]: v}), {}) : null; - return { id: msg.wamid, text: templateDataMapped?.body?.text || templateDataMapped?.body?.parameters?.[0]?.text || '', title: msg.template.name } + return { id: msg.wamid, text: autoLinkText(templateDataMapped?.body?.text || templateDataMapped?.body?.parameters?.[0]?.text || ''), title: msg.template.name } }, renderForReply: (msg) => { const templateDataMapped = msg.template?.components ? msg.template.components.reduce((r, v) => ({ ...r, [v.type]: v }), {}) : null; diff --git a/src/views/Conversations/Components/Input/Template.jsx b/src/views/Conversations/Components/Input/Template.jsx index 6a83717..b631568 100644 --- a/src/views/Conversations/Components/Input/Template.jsx +++ b/src/views/Conversations/Components/Input/Template.jsx @@ -58,7 +58,7 @@ const InputTemplate = ({ disabled = false, invokeSendMessage }) => { name: fromTemplate.name, language: { code: fromTemplate.language }, components: fromTemplate.components_origin.map((citem) => { - const keys = (citem?.text || '').match(/{{(.*?)}}/g).map((key) => key.replace(/{{|}}/g, '')); + const keys = ((citem?.text || '').match(/{{(.*?)}}/g) || []).map((key) => key.replace(/{{|}}/g, '')); const params = keys.map((v) => ({ type: 'text', text: getNestedValue(mergeInput, [v]) })); const paramText = params.map((p) => p.text); const fillTemplate = paramText.length ? replaceTemplateString(citem?.text || '', paramText) : citem?.text || ''; diff --git a/src/views/Conversations/Conversations.css b/src/views/Conversations/Conversations.css index 01af593..01c5c74 100644 --- a/src/views/Conversations/Conversations.css +++ b/src/views/Conversations/Conversations.css @@ -15,6 +15,9 @@ background: linear-gradient(0deg,#00000014,#0000); color: #00000073; } +.chatwindow-wrapper .rce-mbox-text a{ + color: #4f81a1; +} .chatwindow-wrapper .rce-mbox-text:after{ content: none; }