From a676d1bb5638ef1329a515ded847a2c858dc348f Mon Sep 17 00:00:00 2001 From: Claudemir Todo Bom Date: Sat, 30 Nov 2024 11:55:51 -0300 Subject: [PATCH] correct notification when received a vcard - fix #241 --- frontend/src/components/NotificationsPopOver/index.js | 4 +++- frontend/src/components/TicketListItem/index.js | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/NotificationsPopOver/index.js b/frontend/src/components/NotificationsPopOver/index.js index 467ec89..5c93557 100644 --- a/frontend/src/components/NotificationsPopOver/index.js +++ b/frontend/src/components/NotificationsPopOver/index.js @@ -178,8 +178,10 @@ const NotificationsPopOver = (props) => { const handleNotifications = (data) => { const { message, contact, ticket } = data; + const body = message.body.startsWith('{"ticketzvCard"') ? "🪪" : message.body; + const options = { - body: `${message.body} - ${format(new Date(), "HH:mm")}`, + body: `${format(new Date(), "HH:mm")}\n${body}`, icon: contact.profilePicUrl, tag: ticket.id, renotify: true, diff --git a/frontend/src/components/TicketListItem/index.js b/frontend/src/components/TicketListItem/index.js index aaf3cbe..5549dc7 100644 --- a/frontend/src/components/TicketListItem/index.js +++ b/frontend/src/components/TicketListItem/index.js @@ -208,7 +208,11 @@ const TicketListItem = ({ ticket, groupActionButtons }) => { color="textSecondary" > {ticket.lastMessage ? ( - {ticket.lastMessage} + + { + ticket.lastMessage.startsWith('{"ticketzvCard"') ? "🪪" : ticket.lastMessage + } + ) : (
)}