Merge pull request #494 from LemmyNet/fix_null_person_blocks

Fixing error for null person_block. Fixes #491
This commit is contained in:
Dessalines 2021-11-18 12:21:02 -05:00 committed by GitHub
commit 3f763b6f71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -133,7 +133,7 @@ export class Profile extends Component<any, ProfileState> {
} }
setPersonBlock() { setPersonBlock() {
this.state.personBlocked = UserService.Instance.myUserInfo.person_blocks this.state.personBlocked = UserService.Instance.myUserInfo?.person_blocks
.map(a => a.target.id) .map(a => a.target.id)
.includes(this.state.personRes?.person_view.person.id); .includes(this.state.personRes?.person_view.person.id);
} }
@ -411,7 +411,7 @@ export class Profile extends Component<any, ProfileState> {
</ul> </ul>
</div> </div>
<div className="flex-grow-1 unselectable pointer mx-2"></div> <div className="flex-grow-1 unselectable pointer mx-2"></div>
{!this.isCurrentUser && ( {!this.isCurrentUser && UserService.Instance.myUserInfo && (
<> <>
<a <a
className={`d-flex align-self-start btn btn-secondary mr-2 ${ className={`d-flex align-self-start btn btn-secondary mr-2 ${