From aeb692499d60056bb99a622e4fad10ab76e79c1f Mon Sep 17 00:00:00 2001 From: Christopher Date: Mon, 15 Feb 2021 18:30:47 +0100 Subject: [PATCH] fix(phone/contacts): resolve issue where avatar is undefined --- .../apps/contacts/components/views/ContactInfo.tsx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/phone/src/apps/contacts/components/views/ContactInfo.tsx b/phone/src/apps/contacts/components/views/ContactInfo.tsx index bf147cf..9235746 100644 --- a/phone/src/apps/contacts/components/views/ContactInfo.tsx +++ b/phone/src/apps/contacts/components/views/ContactInfo.tsx @@ -79,9 +79,9 @@ const ContactsInfoPage = () => { const contact = getContact(parseInt(id)); // Set state after checking if null - const [name, setName] = useState(contact ? contact.display : contact); - const [number, setNumber] = useState(contact ? contact.number : contact); - const [avatar, setAvatar] = useState(contact ? contact.avatar : contact); + const [name, setName] = useState(contact ? contact.display : ''); + const [number, setNumber] = useState(contact ? contact.number : ''); + const [avatar, setAvatar] = useState(contact ? contact.avatar : ''); const { t } = useTranslation(); @@ -132,11 +132,7 @@ const ContactsInfoPage = () => {
- {avatar ? ( - - ) : ( - - )} +