From c044f06447e05ea0bd32607799d51bc35c79ec7b Mon Sep 17 00:00:00 2001 From: SleeplessOne1917 Date: Wed, 27 Sep 2023 17:13:02 -0400 Subject: [PATCH] fix: Fix linting errors --- src/shared/components/person/profile.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/shared/components/person/profile.tsx b/src/shared/components/person/profile.tsx index 9821bd80..23382234 100644 --- a/src/shared/components/person/profile.tsx +++ b/src/shared/components/person/profile.tsx @@ -156,10 +156,11 @@ const Follows = () => getCommunitiesListing("subscribed", UserService.Instance.myUserInfo?.follows); const isPersonBlocked = (personRes: RequestState) => - personRes.state === "success" && - UserService.Instance.myUserInfo?.person_blocks.some( - ({ target: { id } }) => id === personRes.data.person_view.person.id, - ); + (personRes.state === "success" && + UserService.Instance.myUserInfo?.person_blocks.some( + ({ target: { id } }) => id === personRes.data.person_view.person.id, + )) ?? + false; export class Profile extends Component< RouteComponentProps<{ username: string }>, @@ -787,7 +788,7 @@ export class Profile extends Component< }); if (res.state === "success") { updatePersonBlock(res.data); - this.setState({ personBlocked: isPersonBlocked(res) }); + this.setState({ personBlocked: res.data.blocked }); } }