|
|
|
@ -91,8 +91,6 @@ const selectNotification = (id) => {
|
|
|
|
|
|
|
|
|
|
const dataRequest = JSON.parse(localStorage.getItem('obj_contact')) |
|
|
|
|
|
|
|
|
|
console.log(dataRequest) |
|
|
|
|
|
|
|
|
|
listarAtendimentoAgente(localStorage.getItem('my_uniqueid')) |
|
|
|
|
const allNotifications = JSON.parse(localStorage.getItem('obj_notification')) |
|
|
|
|
|
|
|
|
@ -113,7 +111,7 @@ const selectNotification = (id) => {
|
|
|
|
|
|
|
|
|
|
if(dataRequest.data.length > 0){ |
|
|
|
|
dataContact = dataRequest.data.filter(e => { |
|
|
|
|
if(id.trim() == e.event?.mensagem.uniqueid){ |
|
|
|
|
if(id.trim() == e.uniqueid){ |
|
|
|
|
return true |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
@ -143,33 +141,33 @@ const selectNotification = (id) => {
|
|
|
|
|
alertNotification(localStorage.getItem('session_uniqueid'),'remove') |
|
|
|
|
|
|
|
|
|
dataContact.forEach(e => { |
|
|
|
|
const datesend = e.event?.mensagem.datetime ? converdata(new Date(e.event?.mensagem.datetime).getTime()) : 'algumas horas'; |
|
|
|
|
let typesend = localStorage.getItem('my_uniqueid') == e.event.contact.number ? 'sender': 'receiver' |
|
|
|
|
const datesend = e.msg_date ? converdata(new Date(e.msg_date).getTime()) : 'algumas horas'; |
|
|
|
|
let typesend = localStorage.getItem('my_uniqueid') == e.dst ? 'sender': 'receiver' |
|
|
|
|
|
|
|
|
|
if(e.event?.mensagem.type == 'text'){ |
|
|
|
|
if(e.type == 'text'){ |
|
|
|
|
$('.chat-window').append(` |
|
|
|
|
<div class="${typesend}"> |
|
|
|
|
<span class="${typesend}-message">${e.event.mensagem.content}</span> |
|
|
|
|
<span class="${typesend}-message">${e.content}</span> |
|
|
|
|
<br/> |
|
|
|
|
<span class="message-time">${datesend}</span> |
|
|
|
|
</div>` |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(e.event?.mensagem.type == 'finish' || e.event?.mensagem.type == 're_start'){ |
|
|
|
|
if(e.type == 'finish' || e.type == 're_start'){ |
|
|
|
|
$('.chat-window').append(` |
|
|
|
|
<div class="events"> |
|
|
|
|
<span class="events-message">${e.event.mensagem.content}</span> |
|
|
|
|
<span class="events-message">${e.content}</span> |
|
|
|
|
</div>` |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(e.event?.mensagem.type != 'text'){ |
|
|
|
|
if(e.type != 'text'){ |
|
|
|
|
const sendobj = { |
|
|
|
|
filename: e.event?.mensagem.file_name, |
|
|
|
|
id_provedor: e.event?.mensagem.id_provedor,
|
|
|
|
|
type: e.event?.mensagem.type,
|
|
|
|
|
mimetype: e.event?.mensagem.mimetype,
|
|
|
|
|
filename: e.file_name, |
|
|
|
|
id_provedor: e.id_provedor,
|
|
|
|
|
type: e.type,
|
|
|
|
|
mimetype: e.mimetype,
|
|
|
|
|
from: typesend |
|
|
|
|
} |
|
|
|
|
messageTypeMedia(sendobj) |
|
|
|
|