From d4f1f981a5143663e03a1daab8105cc11b39820d Mon Sep 17 00:00:00 2001
From: JoramWilander <jwawilander@gmail.com>
Date: Thu, 22 Oct 2015 08:45:28 -0400
Subject: Auto-embed gifs from .gif links

---
 web/react/components/post_list.jsx | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

(limited to 'web/react/components/post_list.jsx')

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}
                 />
             );
 
-- 
cgit v1.2.3-1-g7c22

