diff --git a/apps/meteor/client/views/omnichannel/directory/contacts/ContactTable.tsx b/apps/meteor/client/views/omnichannel/directory/contacts/ContactTable.tsx index 816e4a20569c5..2cc4127bc20c9 100644 --- a/apps/meteor/client/views/omnichannel/directory/contacts/ContactTable.tsx +++ b/apps/meteor/client/views/omnichannel/directory/contacts/ContactTable.tsx @@ -128,7 +128,7 @@ function ContactTable({ setContactReload }: ContactTableProps): ReactElement { {result.phase === AsyncStatePhase.RESOLVED && ( - {result.value.visitors.map(({ _id, username, name, visitorEmails, phone, lastChat }) => { + {result.value.visitors.map(({ _id, username, fname, visitorEmails, phone, lastChat }) => { const phoneNumber = phone?.length && phone[0].phoneNumber; const visitorEmail = visitorEmails?.length && visitorEmails[0].address; @@ -144,7 +144,7 @@ function ContactTable({ setContactReload }: ContactTableProps): ReactElement { onClick={onRowClick(_id)} > {username} - {parseOutboundPhoneNumber(name)} + {parseOutboundPhoneNumber(fname)} {parseOutboundPhoneNumber(phoneNumber)} {visitorEmail} {lastChat && formatDate(lastChat.ts)} diff --git a/apps/meteor/client/views/omnichannel/directory/contacts/contextualBar/ContactInfo.js b/apps/meteor/client/views/omnichannel/directory/contacts/contextualBar/ContactInfo.js index cdafe62dcc8a3..a6f47b490176c 100644 --- a/apps/meteor/client/views/omnichannel/directory/contacts/contextualBar/ContactInfo.js +++ b/apps/meteor/client/views/omnichannel/directory/contacts/contextualBar/ContactInfo.js @@ -89,7 +89,7 @@ const ContactInfo = ({ id, rid, route }) => { } const { - contact: { name, username, visitorEmails, phone, livechatData, ts, lastChat, contactManager }, + contact: { fname, username, visitorEmails, phone, livechatData, ts, lastChat, contactManager }, } = data; const checkIsVisibleAndScopeVisitor = (key) => { @@ -107,7 +107,7 @@ const ContactInfo = ({ id, rid, route }) => { const showContactHistory = currentRouteName === 'live' && lastChat; - const displayName = parseOutboundPhoneNumber(name) || username; + const displayName = parseOutboundPhoneNumber(fname) || username; const { phoneNumber } = phone?.[0] || {}; diff --git a/apps/meteor/client/views/room/Header/Omnichannel/VoipRoomHeader.tsx b/apps/meteor/client/views/room/Header/Omnichannel/VoipRoomHeader.tsx index c1b9e5d3ecc0a..de204caaebabd 100644 --- a/apps/meteor/client/views/room/Header/Omnichannel/VoipRoomHeader.tsx +++ b/apps/meteor/client/views/room/Header/Omnichannel/VoipRoomHeader.tsx @@ -41,7 +41,7 @@ const VoipRoomHeader: FC = ({ slots: parentSlot, room }) => [context], )} > - + ); }; diff --git a/apps/meteor/ee/client/lib/voip/parseOutboundPhoneNumber.ts b/apps/meteor/ee/client/lib/voip/parseOutboundPhoneNumber.ts index 711c53e6270d5..ec619ef354729 100644 --- a/apps/meteor/ee/client/lib/voip/parseOutboundPhoneNumber.ts +++ b/apps/meteor/ee/client/lib/voip/parseOutboundPhoneNumber.ts @@ -1 +1 @@ -export const parseOutboundPhoneNumber = (phoneNumber: string): string => (phoneNumber ? phoneNumber.replace(/\*/g, '+') : ''); +export const parseOutboundPhoneNumber = (phoneNumber: string | undefined): string => (phoneNumber ? phoneNumber.replace(/\*/g, '+') : '');