From 532bc88ecc233e0bd59d7b06927262fa1ed1ce1d Mon Sep 17 00:00:00 2001
From: Ansh Nanda <anshnanda10@gmail.com>
Date: Tue, 16 May 2023 16:31:35 -0700
Subject: fix edge case when feed is liked only by one person

---
 src/view/com/algos/AlgoItem.tsx | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

(limited to 'src/view/com/algos/AlgoItem.tsx')

diff --git a/src/view/com/algos/AlgoItem.tsx b/src/view/com/algos/AlgoItem.tsx
index ffb8791a8..6fbbd0df1 100644
--- a/src/view/com/algos/AlgoItem.tsx
+++ b/src/view/com/algos/AlgoItem.tsx
@@ -17,6 +17,7 @@ import {useFocusEffect, useNavigation} from '@react-navigation/native'
 import {NavigationProp} from 'lib/routes/types'
 import {useStores} from 'state/index'
 import {HeartIconSolid} from 'lib/icons'
+import {pluralize} from 'lib/strings/helpers'
 
 const AlgoItem = observer(
   ({
@@ -80,8 +81,11 @@ const AlgoItem = observer(
 
               <HeartIconSolid size={16} style={[s.mr2, {color: colors.red3}]} />
               <Text style={[pal.text, pal.textLight]}>
-                {item.data.likeCount && item.data.likeCount > 1
-                  ? `Liked by ${item.data.likeCount} others`
+                {item.data.likeCount && item.data.likeCount > 0
+                  ? `Liked by ${item.data.likeCount} ${pluralize(
+                      item.data.likeCount,
+                      'other',
+                    )}`
                   : 'Be the first to like this'}
               </Text>
             </View>
-- 
cgit 1.4.1

