From e7611e949fe616f034fd9bafe6b4ae1e0d5b5c73 Mon Sep 17 00:00:00 2001 From: Simples IP Desenvolvimento Date: Mon, 29 Aug 2022 09:06:34 -0400 Subject: [PATCH] teste --- public/js/main.js | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/public/js/main.js b/public/js/main.js index 65773cb..8ed0510 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -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(`
- ${e.event.mensagem.content} + ${e.content}
${datesend}
` ) } - if(e.event?.mensagem.type == 'finish' || e.event?.mensagem.type == 're_start'){ + if(e.type == 'finish' || e.type == 're_start'){ $('.chat-window').append(`
- ${e.event.mensagem.content} + ${e.content}
` ) } - 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)