diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2018-03-07 08:28:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-07 08:28:52 +0100 |
commit | cfa9b6e13ab3c434f3901df6f614d0aa94a3d1ed (patch) | |
tree | e303778680cdd80ad5a31ec5fb3b28ba5dc834ef /app/javascript/mastodon/components | |
parent | e26d5ca923353c9cd61073c444c0841bae4b9664 (diff) |
Remove text requirement when media attached from statuses (#6672)
Diffstat (limited to 'app/javascript/mastodon/components')
-rw-r--r-- | app/javascript/mastodon/components/status_content.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/app/javascript/mastodon/components/status_content.js b/app/javascript/mastodon/components/status_content.js index 3b8155632..701b5702c 100644 --- a/app/javascript/mastodon/components/status_content.js +++ b/app/javascript/mastodon/components/status_content.js @@ -24,7 +24,12 @@ export default class StatusContent extends React.PureComponent { }; _updateStatusLinks () { - const node = this.node; + const node = this.node; + + if (!node) { + return; + } + const links = node.querySelectorAll('a'); for (var i = 0; i < links.length; ++i) { @@ -115,6 +120,10 @@ export default class StatusContent extends React.PureComponent { render () { const { status } = this.props; + if (status.get('content').length === 0) { + return null; + } + const hidden = this.props.onExpandedToggle ? !this.props.expanded : this.state.hidden; const content = { __html: status.get('contentHtml') }; |