summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-06-01 14:16:51 -0400
committerGitHub <noreply@github.com>2017-06-01 14:16:51 -0400
commit8ad057c2c7f8f05c183f4e1b91d3eee112c8831d (patch)
treea7cdbb7454e52251114dd9303ea19aed0c6430a0 /webapp
parentf662d0d63283a928e02fe99572fbf1081a79cb53 (diff)
downloadchat-8ad057c2c7f8f05c183f4e1b91d3eee112c8831d.tar.gz
chat-8ad057c2c7f8f05c183f4e1b91d3eee112c8831d.tar.bz2
chat-8ad057c2c7f8f05c183f4e1b91d3eee112c8831d.zip
Prevent re-rendering of sidebar when typing into channel switcher (#6547)
Diffstat (limited to 'webapp')
-rw-r--r--webapp/components/sidebar.jsx8
1 files changed, 4 insertions, 4 deletions
diff --git a/webapp/components/sidebar.jsx b/webapp/components/sidebar.jsx
index a802c2f4f..5674e8c75 100644
--- a/webapp/components/sidebar.jsx
+++ b/webapp/components/sidebar.jsx
@@ -105,11 +105,12 @@ export default class Sidebar extends React.Component {
const preferences = getMyPreferences(store.getState());
const profiles = getUsers(store.getState());
let displayableChannels = {};
- if (channels !== this.oldChannels ||
- preferences !== this.oldPreferences ||
- profiles !== this.oldProfiles) {
+ if (!Utils.areObjectsEqual(channels, this.oldChannels) ||
+ !Utils.areObjectsEqual(preferences, this.oldPreferences) ||
+ !Utils.areObjectsEqual(profiles, this.oldProfiles)) {
const channelsArray = channels.map((channel) => Object.assign({}, channel));
displayableChannels = ChannelUtils.buildDisplayableChannelList(channelsArray);
+ displayableChannels.favoriteChannels.sort(sortTeamsByDisplayName);
}
this.oldChannels = channels;
this.oldPreferences = preferences;
@@ -641,7 +642,6 @@ export default class Sidebar extends React.Component {
// create elements for all 4 types of channels
const favoriteItems = this.state.favoriteChannels.
- sort(sortTeamsByDisplayName).
map((channel, index, arr) => {
if (channel.type === Constants.DM_CHANNEL) {
return this.createChannelElement(channel, index, arr, this.handleLeaveDirectChannel);