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') 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, read: 1,
fromMe: true, fromMe: true,
mediaUrl: "", mediaUrl: "",
body: (signMessage && !templateParams) body: (signMessage && !templateParams) ? `*${user?.name}:*\n${inputMessage.trim()}` : inputMessage.trim(),
? `*${user?.name}:*\n${inputMessage.trim()}` quotedMsg: replyingMessage
: inputMessage.trim(),
quotedMsg: replyingMessage,
params: templateParams
} }
if (templateParams) {
message = { ...message, params: templateParams }
}
try { try {
const { data } = await api.post(`/messages/${ticketId}`, message) const { data } = await api.post(`/messages/${ticketId}`, message)