aboutsummaryrefslogtreecommitdiff
path: root/src/components/common/FriendsButton.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-04-20 17:16:46 -0400
committerIvan Chen <ivan@tagg.id>2021-04-20 17:21:46 -0400
commitbae0136cb1939302b758249a1978251bd37aaee8 (patch)
tree8788895fe72bef062a4de3b3b8e245d091dc3c1f /src/components/common/FriendsButton.tsx
parent5ff7cab4bd36337b2c86e3d4915a6fc3ceef1ddb (diff)
linted
Diffstat (limited to 'src/components/common/FriendsButton.tsx')
-rw-r--r--src/components/common/FriendsButton.tsx9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/components/common/FriendsButton.tsx b/src/components/common/FriendsButton.tsx
index 6ddad93f..ae901229 100644
--- a/src/components/common/FriendsButton.tsx
+++ b/src/components/common/FriendsButton.tsx
@@ -31,9 +31,12 @@ const FriendsButton: React.FC<FriendsButtonProps> = ({
}) => {
const dispatch = useDispatch();
- const {user = NO_USER, profile = NO_PROFILE} = userXId
- ? useSelector((state: RootState) => state.userX[screenType][userXId])
- : useSelector((state: RootState) => state.user);
+ const {
+ user = NO_USER,
+ profile = NO_PROFILE,
+ } = useSelector((state: RootState) =>
+ userXId ? state.userX[screenType][userXId] : state.user,
+ );
const {user: loggedInUser = NO_USER} = useSelector(
(state: RootState) => state.user,