aboutsummaryrefslogtreecommitdiff
path: root/src/components/profile/FriendsCount.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/profile/FriendsCount.tsx')
-rw-r--r--src/components/profile/FriendsCount.tsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/components/profile/FriendsCount.tsx b/src/components/profile/FriendsCount.tsx
index 9647710e..851dbc3b 100644
--- a/src/components/profile/FriendsCount.tsx
+++ b/src/components/profile/FriendsCount.tsx
@@ -17,10 +17,10 @@ const FriendsCount: React.FC<FriendsCountProps> = ({
userXId,
screenType,
}) => {
- const count = (userXId
+ const {friends} = userXId
? useSelector((state: RootState) => state.userX[screenType][userXId])
- : useSelector((state: RootState) => state.friends)
- )?.friends.length;
+ : useSelector((state: RootState) => state.friends);
+ const count = friends ? friends.length : 0;
const displayedCount: string =
count < 5e3