diff options
author | Thibaut Girka <thib@sitedethib.com> | 2018-03-12 18:39:07 +0100 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2018-03-12 18:39:07 +0100 |
commit | 841ef606a9b1bc3390830643606b3ec9d65d5120 (patch) | |
tree | 74ba0f1cb8611a6e8e52b778ade872f028fb075f /app/javascript/flavours/glitch/components | |
parent | a0724cd7426dec36b7966c86a1708f62e6e5fd4c (diff) |
Remove text requirement when media attached from statuses (fixes #381)
Ports cfa9b6e13ab3c434f3901df6f614d0aa94a3d1ed to glitchsoc
Diffstat (limited to 'app/javascript/flavours/glitch/components')
-rw-r--r-- | app/javascript/flavours/glitch/components/status_content.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/components/status_content.js b/app/javascript/flavours/glitch/components/status_content.js index 0c40e62cc..a15bf7c52 100644 --- a/app/javascript/flavours/glitch/components/status_content.js +++ b/app/javascript/flavours/glitch/components/status_content.js @@ -23,7 +23,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) { @@ -126,6 +131,10 @@ export default class StatusContent extends React.PureComponent { disabled, } = this.props; + if (status.get('content').length === 0) { + return null; + } + const hidden = this.props.setExpansion ? !this.props.expanded : this.state.hidden; const content = { __html: status.get('contentHtml') }; |