From 50815f9be7195d736debd6bcd9d300dd95bbc738 Mon Sep 17 00:00:00 2001
From: JoramWilander <jwawilander@gmail.com>
Date: Thu, 12 Nov 2015 11:19:59 -0500
Subject: Rename areStatesEqual to areObjectsEqual and make it more
 comprehensive and accurate.

---
 web/react/components/sidebar.jsx | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

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

diff --git a/web/react/components/sidebar.jsx b/web/react/components/sidebar.jsx
index f5ce5c10e..c51eea9f6 100644
--- a/web/react/components/sidebar.jsx
+++ b/web/react/components/sidebar.jsx
@@ -173,7 +173,7 @@ export default class Sidebar extends React.Component {
         window.addEventListener('resize', this.handleResize);
     }
     shouldComponentUpdate(nextProps, nextState) {
-        if (!Utils.areStatesEqual(nextState, this.state)) {
+        if (!Utils.areObjectsEqual(nextState, this.state)) {
             return true;
         }
         return false;
@@ -205,10 +205,7 @@ export default class Sidebar extends React.Component {
         }
     }
     onChange() {
-        var newState = this.getStateFromStores();
-        if (!Utils.areStatesEqual(newState, this.state)) {
-            this.setState(newState);
-        }
+        this.setState(this.getStateFromStores());
     }
     updateTitle() {
         const channel = ChannelStore.getCurrent();
-- 
cgit v1.2.3-1-g7c22

