diff options
author | Chris <ccbrown112@gmail.com> | 2017-08-04 13:24:53 -0500 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2017-08-04 14:24:53 -0400 |
commit | efdbb6ee547682da86a1a2115a55a511cf88514d (patch) | |
tree | 06dd2aa821b2e89fbdfc5aaf415081892df902b3 /webapp/components | |
parent | fb2022fb1cb3c8023efd22316d570d9b26facbd1 (diff) | |
download | chat-efdbb6ee547682da86a1a2115a55a511cf88514d.tar.gz chat-efdbb6ee547682da86a1a2115a55a511cf88514d.tar.bz2 chat-efdbb6ee547682da86a1a2115a55a511cf88514d.zip |
fix some webhook attachments not truncating, lower short text to 300 chars (#7120)
Diffstat (limited to 'webapp/components')
-rw-r--r-- | webapp/components/post_view/post_attachment.jsx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/webapp/components/post_view/post_attachment.jsx b/webapp/components/post_view/post_attachment.jsx index d7b1ee774..36fe3bf9f 100644 --- a/webapp/components/post_view/post_attachment.jsx +++ b/webapp/components/post_view/post_attachment.jsx @@ -72,8 +72,9 @@ export default class PostAttachment extends React.PureComponent { let text = this.props.attachment.text || ''; if ((text.match(/\n/g) || []).length >= 5) { text = text.split('\n').splice(0, 5).join('\n'); - } else if (text.length > 700) { - text = text.substr(0, 700); + } + if (text.length > 300) { + text = text.substr(0, 300); } return TextFormatting.formatText(text) + `<div><a class="attachment-link-more" href="#">${localizeMessage('post_attachment.more', 'Show more...')}</a></div>`; |