From 31d8282bdc6d9c93576ee0f171e0fba690d16a99 Mon Sep 17 00:00:00 2001 From: natjms Date: Mon, 3 May 2021 10:27:56 -0300 Subject: [PATCH] Make rendering of profile metadata conditional, as the fields property may not be present --- src/components/pages/profile.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/pages/profile.js b/src/components/pages/profile.js index 6af023d..8c89d1c 100644 --- a/src/components/pages/profile.js +++ b/src/components/pages/profile.js @@ -157,7 +157,6 @@ const ProfileDisplayJsx = ({navigation}) => { const profile = JSON.parse(profileJSON[1]); const notifications = JSON.parse(notificationsJSON[1]); - console.log(notifications); setState({ profile: profile, unreadNotifications: notifications.unread, @@ -259,8 +258,8 @@ const ProfileDisplayJsx = ({navigation}) => { {state.profile.note} - { - state.profile.fields.map((field, index) => ( + { state.profile.fields + ? state.profile.fields.map((field, index) => ( @@ -276,6 +275,7 @@ const ProfileDisplayJsx = ({navigation}) => { )) + : <> } {profileButton}