diff options
author | Ivan Chen <ivan@thetaggid.com> | 2021-01-27 19:32:21 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-27 19:32:21 -0500 |
commit | 19d2a861f260c02031d951f3d43bff8ac672146d (patch) | |
tree | 253abceb267dfb75ac9118995886ff152c1ba74b /src/components/profile/FriendsCount.tsx | |
parent | 60d3d97ad6913369762877a9dbfdaac0473deb28 (diff) | |
parent | dc9556867dd44b706c43678d40802a335ff40658 (diff) |
Merge pull request #203 from IvanIFChen/tma577-profile-slowness
[TMA-577] Profile Slowness
Diffstat (limited to 'src/components/profile/FriendsCount.tsx')
-rw-r--r-- | src/components/profile/FriendsCount.tsx | 6 |
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 |