diff --git a/apps/meteor/client/views/omnichannel/contactInfo/tabs/ContactInfoDetails/ContactManagerInfo.tsx b/apps/meteor/client/views/omnichannel/contactInfo/tabs/ContactInfoDetails/ContactManagerInfo.tsx index f8a58fec5579..23aaf22e8ae9 100644 --- a/apps/meteor/client/views/omnichannel/contactInfo/tabs/ContactInfoDetails/ContactManagerInfo.tsx +++ b/apps/meteor/client/views/omnichannel/contactInfo/tabs/ContactInfoDetails/ContactManagerInfo.tsx @@ -1,4 +1,4 @@ -import { Box } from '@rocket.chat/fuselage'; +import { Box, Skeleton } from '@rocket.chat/fuselage'; import { UserAvatar } from '@rocket.chat/ui-avatar'; import { useEndpoint, useTranslation } from '@rocket.chat/ui-contexts'; import { useQuery } from '@tanstack/react-query'; @@ -12,22 +12,25 @@ const ContactManagerInfo = ({ userId }: ContactManagerInfoProps) => { const t = useTranslation(); const getContactManagerByUsername = useEndpoint('GET', '/v1/users.info'); - const { data, isLoading } = useQuery(['getContactManagerByUserId', userId], async () => getContactManagerByUsername({ userId })); + const { data, isLoading, isError } = useQuery(['getContactManagerByUserId', userId], async () => getContactManagerByUsername({ userId })); - if (isLoading) { + if (isError) { return null; } return ( {t('Contact_Manager')} - - {data?.user.username && } - - + {isLoading && } + {!isLoading && ( + + {data.user.username && } + + + + {data.user.name} - {data?.user.name} - + )} ); };