mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-22 06:36:17 +00:00
Fixing broken federated community paging. Fixes #166
This commit is contained in:
parent
f2fe356384
commit
4b43cdf143
|
@ -405,8 +405,13 @@ export class Community extends Component<any, State> {
|
||||||
const dataTypeStr = paramUpdates.dataType || DataType[this.state.dataType];
|
const dataTypeStr = paramUpdates.dataType || DataType[this.state.dataType];
|
||||||
const sortStr = paramUpdates.sort || this.state.sort;
|
const sortStr = paramUpdates.sort || this.state.sort;
|
||||||
const page = paramUpdates.page || this.state.page;
|
const page = paramUpdates.page || this.state.page;
|
||||||
|
|
||||||
|
let typeView = this.state.communityName
|
||||||
|
? `/c/${this.state.communityName}`
|
||||||
|
: `/community/${this.state.communityId}`;
|
||||||
|
|
||||||
this.props.history.push(
|
this.props.history.push(
|
||||||
`/c/${this.state.communityRes.community_view.community.name}/data_type/${dataTypeStr}/sort/${sortStr}/page/${page}`
|
`${typeView}/data_type/${dataTypeStr}/sort/${sortStr}/page/${page}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ export const routes: IRoutePropsWithFetch[] = [
|
||||||
fetchInitialData: req => Post.fetchInitialData(req),
|
fetchInitialData: req => Post.fetchInitialData(req),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: `/c/:name/data_type/:data_type/sort/:sort/page/:page`,
|
path: `/community/:id/data_type/:data_type/sort/:sort/page/:page`,
|
||||||
component: Community,
|
component: Community,
|
||||||
fetchInitialData: req => Community.fetchInitialData(req),
|
fetchInitialData: req => Community.fetchInitialData(req),
|
||||||
},
|
},
|
||||||
|
@ -82,6 +82,11 @@ export const routes: IRoutePropsWithFetch[] = [
|
||||||
component: Community,
|
component: Community,
|
||||||
fetchInitialData: req => Community.fetchInitialData(req),
|
fetchInitialData: req => Community.fetchInitialData(req),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: `/c/:name/data_type/:data_type/sort/:sort/page/:page`,
|
||||||
|
component: Community,
|
||||||
|
fetchInitialData: req => Community.fetchInitialData(req),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: `/c/:name`,
|
path: `/c/:name`,
|
||||||
component: Community,
|
component: Community,
|
||||||
|
|
Loading…
Reference in a new issue