fix: Update frontend to prevent React.js emoji-related errors
parent
ad89d3ccdb
commit
853f537361
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue