Fix account link in quote

This commit is contained in:
noellabo 2020-07-25 16:52:42 +09:00
parent 5b1f641fd2
commit 2acc45d777
2 changed files with 5 additions and 5 deletions

View file

@ -648,7 +648,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.handleAccountClick} target='_blank' data-id={quote_status.getIn(['account', 'id'])} data-group={quote_status.getIn(['account', 'group'])} 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>

View file

@ -94,11 +94,11 @@ class DetailedStatus extends ImmutablePureComponent {
handleAccountClick = (e) => {
if (e.button === 0 && !(e.ctrlKey || e.metaKey) && this.context.router) {
const { status } = this.props;
const id = e.currentTarget.getAttribute('data-id');
const group = e.currentTarget.getAttribute('data-group') !== 'false';
e.preventDefault();
if (status.getIn(['account', 'group'], false)) {
if (group) {
this.context.router.history.push(`/timelines/groups/${id}`);
} else {
this.context.router.history.push(`/accounts/${id}`);
@ -255,7 +255,7 @@ class DetailedStatus extends ImmutablePureComponent {
} else {
quote = (
<div className='quote-status' data-id={quote_status.get('id')} dataurl={quote_status.get('url')}>
<a href={quote_status.getIn(['account', 'url'])} onClick={this.handleAccountClick} data-id={quote_status.getIn(['account', 'id'])} className='detailed-status__display-name'>
<a href={quote_status.getIn(['account', 'url'])} onClick={this.handleAccountClick} data-id={quote_status.getIn(['account', 'id'])} data-group={quote_status.getIn(['account', 'group'])} className='detailed-status__display-name'>
<div className='detailed-status__display-avatar'><Avatar account={quote_status.get('account')} size={18} /></div>
<DisplayName account={quote_status.get('account')} localDomain={this.props.domain} />
</a>
@ -398,7 +398,7 @@ class DetailedStatus extends ImmutablePureComponent {
return (
<div style={outerStyle}>
<div ref={this.setRef} className={classNames('detailed-status', `detailed-status-${status.get('visibility')}`, { compact, 'detailed-status-with-expiration': expires_date, 'detailed-status-expired': expired })}>
<a href={status.getIn(['account', 'url'])} onClick={this.handleAccountClick} className='detailed-status__display-name'>
<a href={status.getIn(['account', 'url'])} onClick={this.handleAccountClick} data-id={status.getIn(['account', 'id'])} data-group={status.getIn(['account', 'group'])} className='detailed-status__display-name'>
<div className='detailed-status__display-avatar'><Avatar account={status.get('account')} size={48} /></div>
<DisplayName account={status.get('account')} localDomain={this.props.domain} />
</a>