]> Untitled Git - lemmy.git/commitdiff
Fixing communities sorting
authorDessalines <tyhou13@gmx.com>
Sun, 2 Jun 2019 16:41:57 +0000 (09:41 -0700)
committerDessalines <tyhou13@gmx.com>
Sun, 2 Jun 2019 16:41:57 +0000 (09:41 -0700)
- Fixes #159

ui/src/components/communities.tsx

index 96864e9a584bdb96f4705fdd0b077faf8e313abc..4cad766900fce4907a55c215725fda0c5d947ed6 100644 (file)
@@ -47,8 +47,6 @@ export class Communities extends Component<any, CommunitiesState> {
 
   componentDidMount() {
     document.title = "Communities - Lemmy";
-    let table = document.querySelector('#community_table');
-    Sortable.initTable(table);
   }
 
   // Necessary for back button for some reason
@@ -176,6 +174,8 @@ export class Communities extends Component<any, CommunitiesState> {
       this.state.loading = false;
       window.scrollTo(0,0);
       this.setState(this.state);
+      let table = document.querySelector('#community_table');
+      Sortable.initTable(table);
     } else if (op == UserOperation.FollowCommunity) {
       let res: CommunityResponse = msg;
       let found = this.state.communities.find(c => c.id == res.community.id);