From: Dessalines Date: Thu, 18 Nov 2021 15:33:27 +0000 (-0500) Subject: Fixing error for null person_block. Fixes #491 X-Git-Url: http://these/git/readmes/%24%7B%60data:application/README.md?a=commitdiff_plain;h=b27d6e904c3c725a3731c090cc1a1d60e2568558;p=lemmy-ui.git Fixing error for null person_block. Fixes #491 --- diff --git a/src/shared/components/person/profile.tsx b/src/shared/components/person/profile.tsx index 0dfff14..3f4f300 100644 --- a/src/shared/components/person/profile.tsx +++ b/src/shared/components/person/profile.tsx @@ -133,7 +133,7 @@ export class Profile extends Component { } setPersonBlock() { - this.state.personBlocked = UserService.Instance.myUserInfo.person_blocks + this.state.personBlocked = UserService.Instance.myUserInfo?.person_blocks .map(a => a.target.id) .includes(this.state.personRes?.person_view.person.id); } @@ -411,7 +411,7 @@ export class Profile extends Component {
- {!this.isCurrentUser && ( + {!this.isCurrentUser && UserService.Instance.myUserInfo && ( <>