diff options
author | Saturnino Abril <saturnino.abril@gmail.com> | 2017-07-13 08:47:08 +0900 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2017-07-12 19:47:08 -0400 |
commit | 9a654d7b274422789e5d73898244964db7083e9d (patch) | |
tree | 6a3fad8beb6f07f846f66fe04ba3010914e20834 | |
parent | 9dcb339f1282ee958be12145d2ad20965ce5cbe2 (diff) | |
download | chat-9a654d7b274422789e5d73898244964db7083e9d.tar.gz chat-9a654d7b274422789e5d73898244964db7083e9d.tar.bz2 chat-9a654d7b274422789e5d73898244964db7083e9d.zip |
prevent image preview to default view when adding/removing reaction (#6910)
-rw-r--r-- | webapp/components/post_view/post_body_additional_content.jsx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/webapp/components/post_view/post_body_additional_content.jsx b/webapp/components/post_view/post_body_additional_content.jsx index 2782c346f..768b999d0 100644 --- a/webapp/components/post_view/post_body_additional_content.jsx +++ b/webapp/components/post_view/post_body_additional_content.jsx @@ -55,10 +55,12 @@ export default class PostBodyAdditionalContent extends React.PureComponent { } componentWillReceiveProps(nextProps) { - this.setState({ - embedVisible: nextProps.previewCollapsed.startsWith('false'), - link: Utils.extractFirstLink(nextProps.post.message) - }); + if (nextProps.previewCollapsed !== this.props.previewCollapsed || nextProps.post.message !== this.props.post.message) { + this.setState({ + embedVisible: nextProps.previewCollapsed.startsWith('false'), + link: Utils.extractFirstLink(nextProps.post.message) + }); + } } toggleEmbedVisibility() { |