diff --git a/src/components/FriendsComponent/index.jsx b/src/components/FriendsComponent/index.jsx index 4c0bb2699..75184ef62 100644 --- a/src/components/FriendsComponent/index.jsx +++ b/src/components/FriendsComponent/index.jsx @@ -63,7 +63,7 @@ const FriendsComponent = () => { const userData = snapshot.docs[0].data(); const fetchedFriends = []; setName(userData.name); - for (const friendUid of (userData?.Friends || userData?.friends || [])) { + for (const friendUid of userData?.Friends || userData?.friends || []) { const friendData = await getFriendData(friendUid); if (friendData) { fetchedFriends.push({ diff --git a/src/pages/Profile/index.jsx b/src/pages/Profile/index.jsx index 1bb6116b6..361cf2f3c 100644 --- a/src/pages/Profile/index.jsx +++ b/src/pages/Profile/index.jsx @@ -200,9 +200,12 @@ function Profile() { bio: data.bio ? data.bio : "Hi there! I am using Dummygram.", country: data.country ? data.country : "Global", storyTimestamp: data.storyTimestamp, - Friends: data?.Friends?.length||data?.friends?.length,// same as below + Friends: data?.Friends?.length || data?.friends?.length, // same as below }); - setIsFriendAlready(data?.Friends?.includes(user?.uid)||data?.friends?.includes(user?.uid)); // old accounts have friends attribute and new accounts have Friends attribute + setIsFriendAlready( + data?.Friends?.includes(user?.uid) || + data?.friends?.includes(user?.uid), + ); // old accounts have friends attribute and new accounts have Friends attribute } else { setUserExists(false); }