mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-26 00:34:01 +00: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();
|
this.handleHotkeyOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
handleAccountClick = e => {
|
handlePrependAccountClick = e => {
|
||||||
|
this.handleAccountClick(e, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
handleAccountClick = (e, proper = true) => {
|
||||||
if (e && (e.button !== 0 || e.ctrlKey || e.metaKey)) {
|
if (e && (e.button !== 0 || e.ctrlKey || e.metaKey)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -155,7 +159,7 @@ class Status extends ImmutablePureComponent {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.handleHotkeyOpenProfile();
|
this._openProfile(proper);
|
||||||
}
|
}
|
||||||
|
|
||||||
handleExpandedToggle = () => {
|
handleExpandedToggle = () => {
|
||||||
|
@ -244,8 +248,12 @@ class Status extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
handleHotkeyOpenProfile = () => {
|
handleHotkeyOpenProfile = () => {
|
||||||
|
this._openProfile();
|
||||||
|
}
|
||||||
|
|
||||||
|
_openProfile = (proper = true) => {
|
||||||
const { router } = this.context;
|
const { router } = this.context;
|
||||||
const status = this._properStatus();
|
const status = proper ? this._properStatus() : this.props.status;
|
||||||
|
|
||||||
if (!router) {
|
if (!router) {
|
||||||
return;
|
return;
|
||||||
|
@ -349,7 +357,7 @@ class Status extends ImmutablePureComponent {
|
||||||
prepend = (
|
prepend = (
|
||||||
<div className='status__prepend'>
|
<div className='status__prepend'>
|
||||||
<div className='status__prepend-icon-wrapper'><Icon id='retweet' className='status__prepend-icon' fixedWidth /></div>
|
<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>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue