From ddcb9da74fb4ee1233c4c5ba1ab3d9c8edc9aba2 Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 26 Nov 2021 22:04:09 +0100 Subject: [PATCH] Fix opening wrong profile when clicking on username of boosting user in WebUI (#17060) Fixes #16799 --- app/javascript/mastodon/components/status.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/app/javascript/mastodon/components/status.js b/app/javascript/mastodon/components/status.js index 96e6a6c8d2f..9955046c048 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 = (
- }} /> + }} />
);