mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
Fix opening wrong profile when clicking on username of boosting user in WebUI (#17060)
Fixes #16799
This commit is contained in:
parent
912c6b3f49
commit
ddcb9da74f
@ -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>
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user