diff options
author | Gô Shoemake <marrus-sh@users.noreply.github.com> | 2018-03-12 13:09:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-12 13:09:42 -0700 |
commit | 22f2750578c64af4e886b0cc704aa0be4ee209b0 (patch) | |
tree | e78dcbda318956c4d642a3bd16f23b3862cb6113 /app/javascript/flavours/glitch/components | |
parent | 2395a4c31323e5c1433fbf232cd6c52e516a72f5 (diff) | |
parent | 841ef606a9b1bc3390830643606b3ec9d65d5120 (diff) |
Merge pull request #384 from ThibG/glitch-soc/features/no-media-url
Remove text requirement when media attached from statuses (fixes #381)
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') }; |