From 3ac41faabdf1194ab67fc89663180465db0e3ca7 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 26 Jan 2021 10:59:38 -0500 Subject: [PATCH] Make sure trending is local only. Fixes #142 --- package.json | 2 +- src/shared/components/communities.tsx | 3 +++ src/shared/components/create-post.tsx | 3 +++ src/shared/components/main.tsx | 2 ++ yarn.lock | 8 ++++---- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 137d179e..a52c0251 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "eslint": "^7.18.0", "eslint-plugin-jane": "^9.0.6", "husky": "^4.3.8", - "lemmy-js-client": "0.9.0", + "lemmy-js-client": "0.9.1-rc.1", "lint-staged": "^10.5.3", "mini-css-extract-plugin": "^1.3.4", "node-fetch": "^2.6.1", diff --git a/src/shared/components/communities.tsx b/src/shared/components/communities.tsx index b3d288a8..74da2b11 100644 --- a/src/shared/components/communities.tsx +++ b/src/shared/components/communities.tsx @@ -9,6 +9,7 @@ import { FollowCommunity, ListCommunities, SortType, + ListingType, SiteView, } from 'lemmy-js-client'; import { WebSocketService } from '../services'; @@ -274,6 +275,7 @@ export class Communities extends Component { refetch() { let listCommunitiesForm: ListCommunities = { + type_: ListingType.All, sort: SortType.TopAll, limit: communityLimit, page: this.state.page, @@ -289,6 +291,7 @@ export class Communities extends Component { let pathSplit = req.path.split('/'); let page = pathSplit[3] ? Number(pathSplit[3]) : 1; let listCommunitiesForm: ListCommunities = { + type_: ListingType.All, sort: SortType.TopAll, limit: communityLimit, page, diff --git a/src/shared/components/create-post.tsx b/src/shared/components/create-post.tsx index edb2f059..2c0d9c12 100644 --- a/src/shared/components/create-post.tsx +++ b/src/shared/components/create-post.tsx @@ -21,6 +21,7 @@ import { SiteView, ListCommunities, SortType, + ListingType, PostView, } from 'lemmy-js-client'; import { i18n } from '../i18next'; @@ -65,6 +66,7 @@ export class CreatePost extends Component { refetch() { let listCommunitiesForm: ListCommunities = { + type_: ListingType.All, sort: SortType.TopAll, limit: 9999, auth: authField(false), @@ -160,6 +162,7 @@ export class CreatePost extends Component { static fetchInitialData(req: InitialFetchRequest): Promise[] { let listCommunitiesForm: ListCommunities = { + type_: ListingType.All, sort: SortType.TopAll, limit: 9999, }; diff --git a/src/shared/components/main.tsx b/src/shared/components/main.tsx index dbe01300..11ac87bb 100644 --- a/src/shared/components/main.tsx +++ b/src/shared/components/main.tsx @@ -149,6 +149,7 @@ export class Main extends Component { fetchTrendingCommunities() { let listCommunitiesForm: ListCommunities = { + type_: ListingType.Local, sort: SortType.Hot, limit: 6, auth: authField(false), @@ -228,6 +229,7 @@ export class Main extends Component { } let trendingCommunitiesForm: ListCommunities = { + type_: ListingType.Local, sort: SortType.Hot, limit: 6, }; diff --git a/yarn.lock b/yarn.lock index da1278b8..fcc549bd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5629,10 +5629,10 @@ lcid@^1.0.0: dependencies: invert-kv "^1.0.0" -lemmy-js-client@0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.9.0.tgz#952f06004d0f4517ca307a4e3424305731279584" - integrity sha512-VqupLyzZG/4IY9XyDE3ZmtGiw0tccz7wdbhOFutaOloVmo3XTUUuq5xheZK2jzdhNAGSqws0dnaeZcTHWsQGtA== +lemmy-js-client@0.9.1-rc.1: + version "0.9.1-rc.1" + resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.9.1-rc.1.tgz#afe3cb0d4852f849dd087a4756a3771bc920a907" + integrity sha512-aVvo4IeJvIPUvypipk4GnyLB6nVQVLfB0arYrMkVV4L7zrZ/0pGtpkMDLaOAj/KpA6O0u9eLmaou5RberZQolA== levn@^0.4.1: version "0.4.1"