diff options
author | Claire <claire.github-309c@sitedethib.com> | 2021-11-26 22:04:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-26 22:04:09 +0100 |
commit | ddcb9da74fb4ee1233c4c5ba1ab3d9c8edc9aba2 (patch) | |
tree | f3838c164fbfd22770bafea9e96541448be1bff5 /app/javascript/mastodon/components | |
parent | 912c6b3f4933415315c66b530332f6ea8d2cd080 (diff) |
Fix opening wrong profile when clicking on username of boosting user in WebUI (#17060)
Fixes #16799
Diffstat (limited to 'app/javascript/mastodon/components')
-rw-r--r-- | app/javascript/mastodon/components/status.js | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/app/javascript/mastodon/components/status.js b/app/javascript/mastodon/components/status.js index 96e6a6c8d..9955046c0 100644 --- a/app/javascript/mastodon/components/status.js +++ b/app/javascript/mastodon/components/status.js @@ -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> ); |