From e8a8703a4bfd0c245100beb1a0e15551b5c52f84 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 6 Oct 2016 22:07:32 +0200 Subject: Fix how missing display name is displayed (fallback to username) --- app/assets/javascripts/components/components/status.jsx | 8 +++++++- .../javascripts/components/features/account/components/header.jsx | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/components/components/status.jsx b/app/assets/javascripts/components/components/status.jsx index 7115d154e..d3acff3f0 100644 --- a/app/assets/javascripts/components/components/status.jsx +++ b/app/assets/javascripts/components/components/status.jsx @@ -46,11 +46,17 @@ const Status = React.createClass({ var { status, ...other } = this.props; if (status.get('reblog') !== null) { + let displayName = status.getIn(['account', 'display_name']); + + if (displayName.length === 0) { + displayName = status.getIn(['account', 'username']); + } + return (
- {status.getIn(['account', 'display_name'])} reblogged + {displayName} reblogged
diff --git a/app/assets/javascripts/components/features/account/components/header.jsx b/app/assets/javascripts/components/features/account/components/header.jsx index 8a4a629ce..b07a4a967 100644 --- a/app/assets/javascripts/components/features/account/components/header.jsx +++ b/app/assets/javascripts/components/features/account/components/header.jsx @@ -12,6 +12,12 @@ const Header = React.createClass({ render () { const { account } = this.props; + let displayName = account.get('display_name'); + + if (displayName.length === 0) { + displayName = account.get('username'); + } + return (
@@ -19,7 +25,7 @@ const Header = React.createClass({
- {account.get('display_name')} + {displayName} @{account.get('acct')}

{account.get('note')}

-- cgit