Fixing views for remote users. Fixes #120

This commit is contained in:
Dessalines 2021-01-23 18:23:09 -05:00
parent 94e36ad757
commit 8c3c27002b
2 changed files with 11 additions and 1 deletions

View file

@ -885,8 +885,13 @@ export class User extends Component<any, UserState> {
const page = paramUpdates.page || this.state.page;
const viewStr = paramUpdates.view || UserDetailsView[this.state.view];
const sortStr = paramUpdates.sort || this.state.sort;
let typeView = this.state.userName
? `/u/${this.state.userName}`
: `/user/${this.state.userId}`;
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.setState(this.state);

View file

@ -92,6 +92,11 @@ export const routes: IRoutePropsWithFetch[] = [
component: User,
fetchInitialData: req => User.fetchInitialData(req),
},
{
path: `/user/:id/view/:view/sort/:sort/page/:page`,
component: User,
fetchInitialData: req => User.fetchInitialData(req),
},
{
path: `/user/:id`,
component: User,