Skip to content

Commit

Permalink
Fix: #554 概要画面の連絡先がメールアドレスでなかった場合に、リンクにmailtoを強制的につけない (#562)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmycode authored Feb 16, 2024
1 parent 7421c89 commit 5c543c6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/javascript/mastodon/features/about/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ class About extends PureComponent {

const isFullTextSearch = server.getIn(['configuration', 'search', 'enabled']);

const email = server.getIn(['contact', 'email']) || '';
const emailLink = email.startsWith('https://') ? email : `mailto:${email}`;

return (
<Column bindToDocument={!multiColumn} label={intl.formatMessage(messages.title)}>
<div className='scrollable about'>
Expand All @@ -183,7 +186,7 @@ class About extends PureComponent {
<div className='about__meta__column'>
<h4><FormattedMessage id='about.contact' defaultMessage='Contact:' /></h4>

{isLoading ? <Skeleton width='10ch' /> : <a className='about__mail' href={`mailto:${server.getIn(['contact', 'email'])}`}>{server.getIn(['contact', 'email'])}</a>}
{isLoading ? <Skeleton width='10ch' /> : <a className='about__mail' href={emailLink}>{server.getIn(['contact', 'email'])}</a>}
</div>
</div>

Expand Down

0 comments on commit 5c543c6

Please # to comment.