From: Dessalines Date: Thu, 25 Nov 2021 17:40:48 +0000 (-0500) Subject: Fix tippy on component mount. Fixes #509 (#511) X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/readmes/%7B%7D/%7BcommunityRSSUrl%28?a=commitdiff_plain;h=324682b1542e6ff9db7ca38ed41dc047ea298568;p=lemmy-ui.git Fix tippy on component mount. Fixes #509 (#511) --- diff --git a/src/shared/components/community/community.tsx b/src/shared/components/community/community.tsx index 1d77d44..cdab971 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 a1793ae..f44d4cc 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 ccc055b..1e37a58 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 c12038f..e36d014 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 860838d..fd9e656 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(); }