diff --git a/webapp/src/components/place/PrivacyComponent.tsx b/webapp/src/components/place/PrivacyComponent.tsx index 1d72e6a1..f1f18c5e 100644 --- a/webapp/src/components/place/PrivacyComponent.tsx +++ b/webapp/src/components/place/PrivacyComponent.tsx @@ -26,8 +26,6 @@ interface PrivacyComponentState { */ class PrivacyComponent extends Component { - private loadedFriends: boolean = false; - constructor(props: PrivacyComponentProps) { super(props); this.state = { @@ -35,7 +33,7 @@ class PrivacyComponent extends Component(), friendsSelected: [], - loadedFriends: false, + loadedFriends: true, friendsButton: false, prevFriendsButton: false, }; @@ -44,21 +42,10 @@ class PrivacyComponent extends Component { - if (this.state.friendsList.length === 0) { - this.setState(() => ({ - loadedFriends: false, - })); - } else { - this.setState(() => ({ - loadedFriends: true, - })); - } - }).catch((error) => { - this.setState(() => ({ - loadedFriends: true, + await this.getUsers().catch((error) => { + this.setState({ friendsList: [] - })); + }); }); } @@ -66,8 +53,8 @@ class PrivacyComponent extends Component