Make sure trending is local only. Fixes #142

This commit is contained in:
Dessalines 2021-01-26 10:59:38 -05:00
parent 62df9baf73
commit 3ac41faabd
5 changed files with 13 additions and 5 deletions

View file

@ -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",

View file

@ -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<any, CommunitiesState> {
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<any, CommunitiesState> {
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,

View file

@ -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<any, CreatePostState> {
refetch() {
let listCommunitiesForm: ListCommunities = {
type_: ListingType.All,
sort: SortType.TopAll,
limit: 9999,
auth: authField(false),
@ -160,6 +162,7 @@ export class CreatePost extends Component<any, CreatePostState> {
static fetchInitialData(req: InitialFetchRequest): Promise<any>[] {
let listCommunitiesForm: ListCommunities = {
type_: ListingType.All,
sort: SortType.TopAll,
limit: 9999,
};

View file

@ -149,6 +149,7 @@ export class Main extends Component<any, MainState> {
fetchTrendingCommunities() {
let listCommunitiesForm: ListCommunities = {
type_: ListingType.Local,
sort: SortType.Hot,
limit: 6,
auth: authField(false),
@ -228,6 +229,7 @@ export class Main extends Component<any, MainState> {
}
let trendingCommunitiesForm: ListCommunities = {
type_: ListingType.Local,
sort: SortType.Hot,
limit: 6,
};

View file

@ -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"