From 4ce0d2576c0a2594f6b7b72462f450593220562e 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 76721b58..a4c5b620 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 a78e43a7..86800684 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 2badb23e..0b5923c0 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 4627ab48..bec73812 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); -- 2.44.1