From baf5b417d5f209db3763762b6d2a7e15c04be4ab Mon Sep 17 00:00:00 2001 From: mahanstreamer <84676642+mahanstreamer@users.noreply.github.com> Date: Thu, 28 Oct 2021 21:43:10 -0400 Subject: [PATCH] Update profile.tsx --- src/shared/components/person/profile.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/shared/components/person/profile.tsx b/src/shared/components/person/profile.tsx index 08ca5e1e..a60b9bc5 100644 --- a/src/shared/components/person/profile.tsx +++ b/src/shared/components/person/profile.tsx @@ -110,6 +110,7 @@ export class Profile extends Component { } setupTippy(); + this.setPersonBlock() } fetchUserData() { @@ -130,10 +131,9 @@ export class Profile extends Component { this.state.personRes.person_view.person.id ); } - get isBlocked() { + setPersonBlock() { this.state.personBlocked = UserService.Instance.myUserInfo.person_blocks. map(a => a.target.id).includes(this.state.personRes.person_view.person.id) - return this.state.personBlocked } static getViewFromProps(view: string): PersonDetailsView { @@ -426,7 +426,7 @@ export class Profile extends Component { > {i18n.t("send_message")} - {this.isBlocked ? + {this.state.personBlocked ? ( { } else if (op == UserOperation.BlockPerson) { let data = wsJsonToRes(msg).data; updatePersonBlock(data); + this.setPersonBlock() + console.log(this.state.personBlocked) this.setState(this.state); } }