diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2015-10-23 09:40:36 -0400 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2015-10-23 09:40:36 -0400 |
commit | 6724ef4314efbd82e9b608b53679444d60c4ba08 (patch) | |
tree | d418bacee42675152bf0d424b49c6f6ce868e9fc /web/react/components/post_list.jsx | |
parent | 510abb408b7524cad4be3b1bb73231cfba6fbe43 (diff) | |
parent | 4c0e4991e76c18fd39ffadcf5b0e1943fb4cd2c3 (diff) | |
download | chat-6724ef4314efbd82e9b608b53679444d60c4ba08.tar.gz chat-6724ef4314efbd82e9b608b53679444d60c4ba08.tar.bz2 chat-6724ef4314efbd82e9b608b53679444d60c4ba08.zip |
Merge pull request #1140 from mattermost/plt-787
PLT-787 Auto-embed gifs from .gif links
Diffstat (limited to 'web/react/components/post_list.jsx')
-rw-r--r-- | web/react/components/post_list.jsx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx index fd29a303c..3ceef478c 100644 --- a/web/react/components/post_list.jsx +++ b/web/react/components/post_list.jsx @@ -42,6 +42,7 @@ export default class PostList extends React.Component { this.deactivate = this.deactivate.bind(this); this.handleResize = this.handleResize.bind(this); this.resizePostList = this.resizePostList.bind(this); + this.updateScroll = this.updateScroll.bind(this); const state = this.getStateFromStores(props.channelId); state.numToDisplay = Constants.POST_CHUNK_SIZE; @@ -205,9 +206,10 @@ export default class PostList extends React.Component { this.scrollToBottom(); // there's a new post and - // it's by the user and not a comment + // it's by the user (and not from their webhook) and not a comment } else if (isNewPost && userId === firstPost.user_id && + !firstPost.props.from_webhook && !Utils.isComment(firstPost)) { this.scrollToBottom(true); @@ -237,6 +239,11 @@ export default class PostList extends React.Component { this.deactivate(); } } + updateScroll() { + if (!this.scrolled) { + this.scrollToBottom(); + } + } handleResize() { this.setState({ windowHeight: Utils.windowHeight() @@ -550,6 +557,7 @@ export default class PostList extends React.Component { posts={posts} hideProfilePic={hideProfilePic} isLastComment={isLastComment} + resize={this.updateScroll} /> ); |