Skip to content

Commit

Permalink
Fixed people without a profile picture crashing the application
Browse files Browse the repository at this point in the history
  • Loading branch information
StarNumber12046 committed Sep 14, 2024
1 parent 9e59236 commit 67e0e25
Showing 1 changed file with 29 additions and 24 deletions.
53 changes: 29 additions & 24 deletions app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,30 +107,35 @@ export default function App() {
))}
</ScrollView>
<View style={{ width: "100%", top: -80 }}>
{friendsPosts.map((value) => (
<InView
key={value.id}
onChange={(inView) => handleVisibilityChange(value.id, inView)}
>
<ReBeal
userId={value.user.id}
primaryHeight={value.primary.height}
primaryWidth={value.primary.width}
primaryUrl={value.primary.url}
secondaryHeight={value.secondary.height}
secondaryWidth={value.secondary.width}
secondaryUrl={value.secondary.url}
userName={value.user.username}
userUrl={value.user.profilePicture.url}
isLate={value.isLate}
postedAt={value.postedAt}
lateInSeconds={value.lateInSeconds}
isMain={value.isMain}
visible={visibleItems[value.id]} // Pass visibility state here
blurred={myPosts.length <= 0}
/>
</InView>
))}
{friendsPosts.map(
(value) =>
value && (
<InView
key={value.id}
onChange={(inView) =>
handleVisibilityChange(value.id, inView)
}
>
<ReBeal
userId={value.user.id}
primaryHeight={value.primary.height}
primaryWidth={value.primary.width}
primaryUrl={value.primary.url}
secondaryHeight={value.secondary.height}
secondaryWidth={value.secondary.width}
secondaryUrl={value.secondary.url}
userName={value.user.username}
userUrl={(value.user.profilePicture ?? { url: "" }).url}
isLate={value.isLate}
postedAt={value.postedAt}
lateInSeconds={value.lateInSeconds}
isMain={value.isMain}
visible={visibleItems[value.id]} // Pass visibility state here
blurred={myPosts.length <= 0}
/>
</InView>
)
)}
<View style={{ width: "100%", height: 0 }}></View>
</View>
</IOScrollView>
Expand Down

0 comments on commit 67e0e25

Please sign in to comment.