fix if click name in QT can't show post owner's profile(4)

This commit is contained in:
YoheiZuho 2022-05-01 17:03:15 +09:00
parent dfb6657713
commit 43cda1c44f
2 changed files with 5 additions and 6 deletions

View File

@ -30,13 +30,12 @@ class QuoteIndicator extends ImmutablePureComponent {
} }
handleAccountClick = (e) => { handleAccountClick = (e) => {
if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) { if (e.button === 0 && !(e.ctrlKey || e.metaKey)) {
const id = e.currentTarget.getAttribute('data-id');
e.preventDefault(); e.preventDefault();
this.context.router.history.push(`/accounts/${id}`); this.context.router.history.push(`/accounts/${this.props.status.getIn(['account', 'id'])}`);
} }
} }
render () { render () {
const { status, intl } = this.props; const { status, intl } = this.props;

View File

@ -85,10 +85,10 @@ class DetailedStatus extends ImmutablePureComponent {
}; };
handleAccountClick = (e) => { handleAccountClick = (e) => {
if (e.button === 0 && !(e.ctrlKey || e.metaKey) && this.context.router) { if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) {
const id = e.currentTarget.getAttribute('data-id'); const id = e.currentTarget.getAttribute('data-id');
e.preventDefault(); e.preventDefault();
this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`); this.context.router.history.push(`/accounts/${id}`);
} }
e.stopPropagation(); e.stopPropagation();