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); } }