Skip to content

Commit

Permalink
fix: quote account jumping
Browse files Browse the repository at this point in the history
  • Loading branch information
mashirozx committed Dec 21, 2021
1 parent 0749aa9 commit 5c8c489
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion app/javascript/mastodon/components/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,19 @@ class Status extends ImmutablePureComponent {
this._openProfile(proper);
}

handleQuoteAccountClick = e => {
e.preventDefault();

const { router } = this.context;
const status = this._properStatus();

if (!router) {
return;
}

router.history.push(`/@${status.get('quote').getIn(['account', 'acct'])}`);
}

handleQuoteClick = () => {
if (!this.context.router) {
return;
Expand Down Expand Up @@ -641,7 +654,7 @@ class Status extends ImmutablePureComponent {
quote = (
<div className={classNames('quote-status', `status-${quote_status.get('visibility')}`, { muted: this.props.muted })} data-id={quote_status.get('id')}>
<div className='status__info'>
<a onClick={this.handleAccountClick} target='_blank' data-id={quote_status.getIn(['account', 'id'])} href={quote_status.getIn(['account', 'url'])} title={quote_status.getIn(['account', 'acct'])} className='status__display-name'>
<a onClick={this.handleQuoteAccountClick} target='_blank' data-id={quote_status.getIn(['account', 'id'])} href={quote_status.getIn(['account', 'url'])} title={quote_status.getIn(['account', 'acct'])} className='status__display-name'>
<div className='status__avatar'><Avatar account={quote_status.get('account')} size={18} /></div>
<DisplayName account={quote_status.get('account')} />
</a>
Expand Down

0 comments on commit 5c8c489

Please sign in to comment.