Skip to content

Commit

Permalink
Add null checks for preview length
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapawar1 committed Apr 21, 2024
1 parent ba86b45 commit 4e1dd25
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/ContentCard/ContentCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ function ContentCard({
<View style={[styles.reactions, { backgroundColor: '#89CFF0' }]}>
<Emoji name="muscle" />
</View>
{/* heart, clap, muscle, cry, ??? */}

<View style={styles.reactionNumber}>
<Text style={[globalStyles.subtext, styles.reactionText]}>
{reactions?.length}
{reactions?.length ?? 0}
</Text>
</View>
</View>
Expand Down
2 changes: 1 addition & 1 deletion src/components/PreviewCard/PreviewCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function PreviewCard({
{/* heart, clap, muscle, cry, ??? */}
<View style={styles.reactionNumber}>
<Text style={[globalStyles.subtext, styles.reactionText]}>
{reactions?.length}
{reactions?.length ?? 0}
</Text>
</View>
</View>
Expand Down

0 comments on commit 4e1dd25

Please sign in to comment.