mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-29 15:51:14 +00:00
Fixing views for remote users. Fixes #120
This commit is contained in:
parent
94e36ad757
commit
8c3c27002b
2 changed files with 11 additions and 1 deletions
|
@ -885,8 +885,13 @@ export class User extends Component<any, UserState> {
|
||||||
const page = paramUpdates.page || this.state.page;
|
const page = paramUpdates.page || this.state.page;
|
||||||
const viewStr = paramUpdates.view || UserDetailsView[this.state.view];
|
const viewStr = paramUpdates.view || UserDetailsView[this.state.view];
|
||||||
const sortStr = paramUpdates.sort || this.state.sort;
|
const sortStr = paramUpdates.sort || this.state.sort;
|
||||||
|
|
||||||
|
let typeView = this.state.userName
|
||||||
|
? `/u/${this.state.userName}`
|
||||||
|
: `/user/${this.state.userId}`;
|
||||||
|
|
||||||
this.props.history.push(
|
this.props.history.push(
|
||||||
`/u/${this.state.userName}/view/${viewStr}/sort/${sortStr}/page/${page}`
|
`${typeView}/view/${viewStr}/sort/${sortStr}/page/${page}`
|
||||||
);
|
);
|
||||||
this.state.loading = true;
|
this.state.loading = true;
|
||||||
this.setState(this.state);
|
this.setState(this.state);
|
||||||
|
|
|
@ -92,6 +92,11 @@ export const routes: IRoutePropsWithFetch[] = [
|
||||||
component: User,
|
component: User,
|
||||||
fetchInitialData: req => User.fetchInitialData(req),
|
fetchInitialData: req => User.fetchInitialData(req),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: `/user/:id/view/:view/sort/:sort/page/:page`,
|
||||||
|
component: User,
|
||||||
|
fetchInitialData: req => User.fetchInitialData(req),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: `/user/:id`,
|
path: `/user/:id`,
|
||||||
component: User,
|
component: User,
|
||||||
|
|
Loading…
Reference in a new issue