From ebe9627dba16600825d76544624bc9af3b2f7983 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 18 Apr 2019 08:28:24 -0700 Subject: [PATCH] Fixing some community sorting. --- server/src/websocket_server/server.rs | 2 +- ui/src/components/communities.tsx | 3 ++- ui/src/components/main.tsx | 2 +- ui/src/components/post-form.tsx | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/server/src/websocket_server/server.rs b/server/src/websocket_server/server.rs index 76721b586..a4c5b6203 100644 --- a/server/src/websocket_server/server.rs +++ b/server/src/websocket_server/server.rs @@ -876,7 +876,7 @@ impl Perform for ListCommunities { let sort = SortType::from_str(&self.sort).expect("listing sort"); - let communities: Vec = CommunityView::list(&conn, user_id, sort, self.page, Some(9999)).unwrap(); + let communities: Vec = CommunityView::list(&conn, user_id, sort, self.page, self.limit).unwrap(); // Return the jwt serde_json::to_string( diff --git a/ui/src/components/communities.tsx b/ui/src/components/communities.tsx index a78e43a7d..868006844 100644 --- a/ui/src/components/communities.tsx +++ b/ui/src/components/communities.tsx @@ -32,7 +32,8 @@ export class Communities extends Component { ); let listCommunitiesForm: ListCommunitiesForm = { - sort: SortType[SortType.TopAll] + sort: SortType[SortType.TopAll], + limit: 9999, } WebSocketService.Instance.listCommunities(listCommunitiesForm); diff --git a/ui/src/components/main.tsx b/ui/src/components/main.tsx index 2badb23ea..0b5923c08 100644 --- a/ui/src/components/main.tsx +++ b/ui/src/components/main.tsx @@ -59,7 +59,7 @@ export class Main extends Component { let listCommunitiesForm: ListCommunitiesForm = { sort: SortType[SortType.New], - limit: 8 + limit: 6 } WebSocketService.Instance.listCommunities(listCommunitiesForm); diff --git a/ui/src/components/post-form.tsx b/ui/src/components/post-form.tsx index 4627ab48c..bec73812e 100644 --- a/ui/src/components/post-form.tsx +++ b/ui/src/components/post-form.tsx @@ -59,7 +59,8 @@ export class PostForm extends Component { ); let listCommunitiesForm: ListCommunitiesForm = { - sort: SortType[SortType.TopAll] + sort: SortType[SortType.TopAll], + limit: 9999, } WebSocketService.Instance.listCommunities(listCommunitiesForm);