From 324682b1542e6ff9db7ca38ed41dc047ea298568 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 25 Nov 2021 12:40:48 -0500 Subject: [PATCH] Fix tippy on component mount. Fixes #509 (#511) --- src/shared/components/community/community.tsx | 5 ++++- src/shared/components/home/home.tsx | 3 +-- src/shared/components/person/person-details.tsx | 1 - src/shared/components/person/profile.tsx | 5 ++++- src/shared/components/person/settings.tsx | 2 ++ 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/shared/components/community/community.tsx b/src/shared/components/community/community.tsx index 1d77d44f..cdab971c 100644 --- a/src/shared/components/community/community.tsx +++ b/src/shared/components/community/community.tsx @@ -133,7 +133,6 @@ export class Community extends Component { this.fetchCommunity(); this.fetchData(); } - setupTippy(); } fetchCommunity() { @@ -144,6 +143,10 @@ export class Community extends Component { WebSocketService.Instance.send(wsClient.getCommunity(form)); } + componentDidMount() { + setupTippy(); + } + componentWillUnmount() { saveScrollPosition(this.context); this.subscription.unsubscribe(); diff --git a/src/shared/components/home/home.tsx b/src/shared/components/home/home.tsx index a1793ae6..f44d4cc0 100644 --- a/src/shared/components/home/home.tsx +++ b/src/shared/components/home/home.tsx @@ -145,8 +145,6 @@ export class Home extends Component { this.fetchTrendingCommunities(); this.fetchData(); } - - setupTippy(); } fetchTrendingCommunities() { @@ -168,6 +166,7 @@ export class Home extends Component { } WebSocketService.Instance.send(wsClient.communityJoin({ community_id: 0 })); + setupTippy(); } componentWillUnmount() { diff --git a/src/shared/components/person/person-details.tsx b/src/shared/components/person/person-details.tsx index ccc055b9..1e37a581 100644 --- a/src/shared/components/person/person-details.tsx +++ b/src/shared/components/person/person-details.tsx @@ -42,7 +42,6 @@ export class PersonDetails extends Component { this.handlePageChange = this.handlePageChange.bind(this); } - // TODO needed here? componentDidMount() { setupTippy(); } diff --git a/src/shared/components/person/profile.tsx b/src/shared/components/person/profile.tsx index c12038f9..e36d0145 100644 --- a/src/shared/components/person/profile.tsx +++ b/src/shared/components/person/profile.tsx @@ -109,7 +109,6 @@ export class Profile extends Component { this.fetchUserData(); } - setupTippy(); this.setPersonBlock(); } @@ -188,6 +187,10 @@ export class Profile extends Component { } } + componentDidMount() { + setupTippy(); + } + componentWillUnmount() { this.subscription.unsubscribe(); saveScrollPosition(this.context); diff --git a/src/shared/components/person/settings.tsx b/src/shared/components/person/settings.tsx index 860838d1..fd9e6560 100644 --- a/src/shared/components/person/settings.tsx +++ b/src/shared/components/person/settings.tsx @@ -130,7 +130,9 @@ export class Settings extends Component { this.subscription = wsSubscribe(this.parseMessage); this.setUserInfo(); + } + componentDidMount() { setupTippy(); }