From 3346a9a63a7c1db582b2f553269c64f4b4a356ef Mon Sep 17 00:00:00 2001
From: Compaurum <Compaurum@users.noreply.github.com>
Date: Mon, 2 May 2016 15:07:46 +0300
Subject: PLT-2586 Fixed problem when New Messages indicator is triggered by
 own message (#2816)

* Fixed problem when New Messages indicator is triggered by own message

* changed to styleguide
---
 webapp/components/posts_view.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'webapp/components/posts_view.jsx')

diff --git a/webapp/components/posts_view.jsx b/webapp/components/posts_view.jsx
index 327756723..7c1f13fca 100644
--- a/webapp/components/posts_view.jsx
+++ b/webapp/components/posts_view.jsx
@@ -410,7 +410,7 @@ export default class PostsView extends React.Component {
     }
     componentWillReceiveProps(nextProps) {
         if (this.props.postList && this.props.postList.order.length) {
-            if (this.props.postList.order[0] !== nextProps.postList.order[0] && nextProps.scrollType !== PostsView.SCROLL_TYPE_BOTTOM && nextProps.scrollType !== PostsView.SCROLL_TYPE_NEW_MESSAGE) {
+            if (this.props.postList.order[0] !== nextProps.postList.order[0] && nextProps.scrollType !== PostsView.SCROLL_TYPE_BOTTOM && nextProps.scrollType !== PostsView.SCROLL_TYPE_NEW_MESSAGE && nextProps.postList.posts[nextProps.postList.order[0]].user_id !== nextProps.currentUser.id && this.props.postList.order[1] !== nextProps.postList.order[0]) { // new message from another user and not deleted
                 this.setState({showUnreadMessageAlert: true});
             } else if (nextProps.scrollType === PostsView.SCROLL_TYPE_BOTTOM) {
                 this.setState({showUnreadMessageAlert: false});
-- 
cgit v1.2.3-1-g7c22

