Unverified Commit ddcb9da7 authored by Claire's avatar Claire Committed by GitHub
Browse files

Fix opening wrong profile when clicking on username of boosting user in WebUI (#17060)

Fixes #16799
parent 912c6b3f
......@@ -146,7 +146,11 @@ class Status extends ImmutablePureComponent {
this.handleHotkeyOpen();
}
handleAccountClick = e => {
handlePrependAccountClick = e => {
this.handleAccountClick(e, false);
}
handleAccountClick = (e, proper = true) => {
if (e && (e.button !== 0 || e.ctrlKey || e.metaKey)) {
return;
}
......@@ -155,7 +159,7 @@ class Status extends ImmutablePureComponent {
e.preventDefault();
}
this.handleHotkeyOpenProfile();
this._openProfile(proper);
}
handleExpandedToggle = () => {
......@@ -244,8 +248,12 @@ class Status extends ImmutablePureComponent {
}
handleHotkeyOpenProfile = () => {
this._openProfile();
}
_openProfile = (proper = true) => {
const { router } = this.context;
const status = this._properStatus();
const status = proper ? this._properStatus() : this.props.status;
if (!router) {
return;
......@@ -349,7 +357,7 @@ class Status extends ImmutablePureComponent {
prepend = (
<div className='status__prepend'>
<div className='status__prepend-icon-wrapper'><Icon id='retweet' className='status__prepend-icon' fixedWidth /></div>
<FormattedMessage id='status.reblogged_by' defaultMessage='{name} boosted' values={{ name: <a onClick={this.handleAccountClick} data-id={status.getIn(['account', 'id'])} href={status.getIn(['account', 'url'])} className='status__display-name muted'><bdi><strong dangerouslySetInnerHTML={display_name_html} /></bdi></a> }} />
<FormattedMessage id='status.reblogged_by' defaultMessage='{name} boosted' values={{ name: <a onClick={this.handlePrependAccountClick} data-id={status.getIn(['account', 'id'])} href={status.getIn(['account', 'url'])} className='status__display-name muted'><bdi><strong dangerouslySetInnerHTML={display_name_html} /></bdi></a> }} />
</div>
);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment