fix: Update frontend to prevent React.js emoji-related errors

pull/22/head
adriano 2024-02-07 17:07:06 -03:00
parent ad89d3ccdb
commit 853f537361
1 changed files with 23 additions and 6 deletions

View File

@ -321,16 +321,33 @@ const MessageInput = ({ ticketStatus }) => {
setTabOption('open')
}
const message = {
if (templateParams) {
for (let key in templateParams) {
if (templateParams.hasOwnProperty(key)) {
// let value = templateParams[key]
// console.log('key: ', key, ' | ', 'VALUE: ', value)
if (key === '_reactName') {
templateParams = null
break
}
}
}
}
let message = {
read: 1,
fromMe: true,
mediaUrl: "",
body: (signMessage && !templateParams)
? `*${user?.name}:*\n${inputMessage.trim()}`
: inputMessage.trim(),
quotedMsg: replyingMessage,
params: templateParams
body: (signMessage && !templateParams) ? `*${user?.name}:*\n${inputMessage.trim()}` : inputMessage.trim(),
quotedMsg: replyingMessage
}
if (templateParams) {
message = { ...message, params: templateParams }
}
try {
const { data } = await api.post(`/messages/${ticketId}`, message)