]> Untitled Git - lemmy-ui.git/commitdiff
Fix tippy on component mount. Fixes #509 (#511)
authorDessalines <dessalines@users.noreply.github.com>
Thu, 25 Nov 2021 17:40:48 +0000 (12:40 -0500)
committerGitHub <noreply@github.com>
Thu, 25 Nov 2021 17:40:48 +0000 (12:40 -0500)
src/shared/components/community/community.tsx
src/shared/components/home/home.tsx
src/shared/components/person/person-details.tsx
src/shared/components/person/profile.tsx
src/shared/components/person/settings.tsx

index 1d77d44f689047a5ad4d26b832b58e41389e9462..cdab971c2caba827ce5da699fc0229730230cf49 100644 (file)
@@ -133,7 +133,6 @@ export class Community extends Component<any, State> {
       this.fetchCommunity();
       this.fetchData();
     }
-    setupTippy();
   }
 
   fetchCommunity() {
@@ -144,6 +143,10 @@ export class Community extends Component<any, State> {
     WebSocketService.Instance.send(wsClient.getCommunity(form));
   }
 
+  componentDidMount() {
+    setupTippy();
+  }
+
   componentWillUnmount() {
     saveScrollPosition(this.context);
     this.subscription.unsubscribe();
index a1793ae673ccbffcc46de2e0ef9496de9a15c5ff..f44d4cc04503fe013caa5a79d8eeb452f58a9f2d 100644 (file)
@@ -145,8 +145,6 @@ export class Home extends Component<any, HomeState> {
       this.fetchTrendingCommunities();
       this.fetchData();
     }
-
-    setupTippy();
   }
 
   fetchTrendingCommunities() {
@@ -168,6 +166,7 @@ export class Home extends Component<any, HomeState> {
     }
 
     WebSocketService.Instance.send(wsClient.communityJoin({ community_id: 0 }));
+    setupTippy();
   }
 
   componentWillUnmount() {
index ccc055b947888b50c81d0940eca8164ee2fef6f1..1e37a58136ee70451bf147379db0e26eb6dbdad3 100644 (file)
@@ -42,7 +42,6 @@ export class PersonDetails extends Component<PersonDetailsProps, any> {
     this.handlePageChange = this.handlePageChange.bind(this);
   }
 
-  // TODO needed here?
   componentDidMount() {
     setupTippy();
   }
index c12038f924c23d7d35eedfd0f66b5f07b38e0608..e36d0145c1af2fe7ee6023786c52d21a9ea04341 100644 (file)
@@ -109,7 +109,6 @@ export class Profile extends Component<any, ProfileState> {
       this.fetchUserData();
     }
 
-    setupTippy();
     this.setPersonBlock();
   }
 
@@ -188,6 +187,10 @@ export class Profile extends Component<any, ProfileState> {
     }
   }
 
+  componentDidMount() {
+    setupTippy();
+  }
+
   componentWillUnmount() {
     this.subscription.unsubscribe();
     saveScrollPosition(this.context);
index 860838d11687f6689759c7e56287969b046ff162..fd9e6560e4d390ddf13d10d2089483712dcae25d 100644 (file)
@@ -130,7 +130,9 @@ export class Settings extends Component<any, SettingsState> {
     this.subscription = wsSubscribe(this.parseMessage);
 
     this.setUserInfo();
+  }
 
+  componentDidMount() {
     setupTippy();
   }