From 43cda1c44ffca5339a6fc6c6a9944bb8dbfb94ce Mon Sep 17 00:00:00 2001 From: YoheiZuho Date: Sun, 1 May 2022 17:03:15 +0900 Subject: [PATCH] fix if click name in QT can't show post owner's profile(4) --- .../features/compose/components/quote_indicator.js | 7 +++---- .../mastodon/features/status/components/detailed_status.js | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/javascript/mastodon/features/compose/components/quote_indicator.js b/app/javascript/mastodon/features/compose/components/quote_indicator.js index 83578ee65..1d4c6a341 100644 --- a/app/javascript/mastodon/features/compose/components/quote_indicator.js +++ b/app/javascript/mastodon/features/compose/components/quote_indicator.js @@ -30,13 +30,12 @@ class QuoteIndicator extends ImmutablePureComponent { } handleAccountClick = (e) => { - if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) { - const id = e.currentTarget.getAttribute('data-id'); + if (e.button === 0 && !(e.ctrlKey || e.metaKey)) { e.preventDefault(); - this.context.router.history.push(`/accounts/${id}`); + this.context.router.history.push(`/accounts/${this.props.status.getIn(['account', 'id'])}`); } } - + render () { const { status, intl } = this.props; diff --git a/app/javascript/mastodon/features/status/components/detailed_status.js b/app/javascript/mastodon/features/status/components/detailed_status.js index 1b9d1ee5b..9e60b8239 100644 --- a/app/javascript/mastodon/features/status/components/detailed_status.js +++ b/app/javascript/mastodon/features/status/components/detailed_status.js @@ -85,10 +85,10 @@ class DetailedStatus extends ImmutablePureComponent { }; handleAccountClick = (e) => { - if (e.button === 0 && !(e.ctrlKey || e.metaKey) && this.context.router) { + if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) { const id = e.currentTarget.getAttribute('data-id'); e.preventDefault(); - this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`); + this.context.router.history.push(`/accounts/${id}`); } e.stopPropagation();