Updated status component to use properStatus when going to status page
Takes into account if is reblog or not and uses the original poster information if so, otherwise use status url as normal. Fixes issue with clicking on status and it goes to wrong url of the reposter and shows error message.
This commit is contained in:
parent
abd4a831a2
commit
8ccb710665
|
@ -168,8 +168,7 @@ class Status extends ImmutablePureComponent {
|
|||
return;
|
||||
}
|
||||
|
||||
const { status } = this.props;
|
||||
this.context.router.history.push(`/${status.getIn(['account', 'acct'])}/posts/${status.getIn(['reblog', 'id'], status.get('id'))}`);
|
||||
this.context.router.history.push(`/${this._properStatus().getIn(['account', 'acct'])}/posts/${this._properStatus().get('id')}`);
|
||||
}
|
||||
|
||||
handleExpandClick = (e) => {
|
||||
|
@ -178,12 +177,7 @@ class Status extends ImmutablePureComponent {
|
|||
return;
|
||||
}
|
||||
|
||||
const { status } = this.props;
|
||||
|
||||
const isReblog = !!status.getIn(['reblog', 'id']);
|
||||
const originalPosterUsername = isReblog ? status.getIn(['reblog', 'account', 'acct']) : status.getIn(['account', 'acct']);
|
||||
|
||||
this.context.router.history.push(`/${originalPosterUsername}/posts/${status.getIn(['reblog', 'id'], status.get('id'))}`);
|
||||
this.context.router.history.push(`/${this._properStatus().getIn(['account', 'acct'])}/posts/${this._properStatus().get('id')}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -222,7 +216,7 @@ class Status extends ImmutablePureComponent {
|
|||
}
|
||||
|
||||
handleHotkeyOpen = () => {
|
||||
this.context.router.history.push(`/${status.getIn(['account', 'acct'])}/posts/${this._properStatus().get('id')}`);
|
||||
this.context.router.history.push(`/${this._properStatus().getIn(['account', 'acct'])}/posts/${this._properStatus().get('id')}`);
|
||||
}
|
||||
|
||||
handleHotkeyOpenProfile = () => {
|
||||
|
|
Loading…
Reference in New Issue