diff options
author | pluralcafe-docker <git@plural.cafe> | 2019-01-21 04:35:41 +0000 |
---|---|---|
committer | pluralcafe-docker <git@plural.cafe> | 2019-01-21 04:35:41 +0000 |
commit | 657438e95054ba1f161db698acdf7f1a871d1c9c (patch) | |
tree | a3344b6105b7771983f69c789fb2f7a0c22a8583 /app/javascript/flavours/glitch/components | |
parent | d899138556513c8a5fa3397606ecc4752b7c6785 (diff) | |
parent | b7c67605d5c2110b4a3cd3d8a7b8ef2878cbfe48 (diff) |
Merge branch 'master' into production
Diffstat (limited to 'app/javascript/flavours/glitch/components')
-rw-r--r-- | app/javascript/flavours/glitch/components/display_name.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/components/display_name.js b/app/javascript/flavours/glitch/components/display_name.js index d6ac4907d..a26cff049 100644 --- a/app/javascript/flavours/glitch/components/display_name.js +++ b/app/javascript/flavours/glitch/components/display_name.js @@ -9,15 +9,23 @@ export default function DisplayName ({ account, className, inline, + localDomain, }) { const computedClass = classNames('display-name', { inline }, className); + if (!account) return null; + + let acct = account.get('acct'); + if (acct.indexOf('@') === -1 && localDomain) { + acct = `${acct}@${localDomain}`; + } + // The result. return account ? ( <span className={computedClass}> <bdi><strong className='display-name__html' dangerouslySetInnerHTML={{ __html: account.get('display_name_html') }} /></bdi> {inline ? ' ' : null} - <span className='display-name__account'>@{account.get('acct')}</span> + <span className='display-name__account'>@{acct}</span> </span> ) : null; } @@ -27,4 +35,5 @@ DisplayName.propTypes = { account: ImmutablePropTypes.map, className: PropTypes.string, inline: PropTypes.bool, + localDomain: PropTypes.string, }; |