diff options
author | Ryan Wang <R-Wang97@users.noreply.github.com> | 2017-03-16 14:27:33 -0400 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2017-03-16 11:27:33 -0700 |
commit | 04c0223c6402b12e67c61474ae310b0a56af6482 (patch) | |
tree | 7690e70e4229a6d9226fc1c3a30b470fa0f6b470 /webapp | |
parent | 91355f0e7d063729c2ba5cb1fc8ff39a346bae04 (diff) | |
download | chat-04c0223c6402b12e67c61474ae310b0a56af6482.tar.gz chat-04c0223c6402b12e67c61474ae310b0a56af6482.tar.bz2 chat-04c0223c6402b12e67c61474ae310b0a56af6482.zip |
Sort favorite channels alphabetically regardless of type (#5739)
Diffstat (limited to 'webapp')
-rw-r--r-- | webapp/components/sidebar.jsx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/webapp/components/sidebar.jsx b/webapp/components/sidebar.jsx index 08d80d363..b9356c5a1 100644 --- a/webapp/components/sidebar.jsx +++ b/webapp/components/sidebar.jsx @@ -636,13 +636,15 @@ export default class Sidebar extends React.Component { this.lastUnreadChannel = null; // create elements for all 4 types of channels - const favoriteItems = this.state.favoriteChannels.map((channel, index, arr) => { - if (channel.type === Constants.DM_CHANNEL) { - return this.createChannelElement(channel, index, arr, this.handleLeaveDirectChannel); - } + const favoriteItems = this.state.favoriteChannels. + sort(Utils.sortTeamsByDisplayName). + map((channel, index, arr) => { + if (channel.type === Constants.DM_CHANNEL) { + return this.createChannelElement(channel, index, arr, this.handleLeaveDirectChannel); + } - return this.createChannelElement(channel); - }); + return this.createChannelElement(channel); + }); const publicChannelItems = this.state.publicChannels.map(this.createChannelElement); |