summaryrefslogtreecommitdiffstats
path: root/webapp/components/sidebar.jsx
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-05-06 12:08:58 -0400
committerJoram Wilander <jwawilander@gmail.com>2016-05-06 12:08:58 -0400
commit0cfcf5c5decc89a8a8070272f92da0c0ae49693d (patch)
treeba2018c98116b80c33b3c33fcdece64e908bea72 /webapp/components/sidebar.jsx
parentd2f9fd52fe8b0da6f23775f242660329fcef6421 (diff)
downloadchat-0cfcf5c5decc89a8a8070272f92da0c0ae49693d.tar.gz
chat-0cfcf5c5decc89a8a8070272f92da0c0ae49693d.tar.bz2
chat-0cfcf5c5decc89a8a8070272f92da0c0ae49693d.zip
Add separator between DMs on your team and not (#2910)
Diffstat (limited to 'webapp/components/sidebar.jsx')
-rw-r--r--webapp/components/sidebar.jsx20
1 files changed, 19 insertions, 1 deletions
diff --git a/webapp/components/sidebar.jsx b/webapp/components/sidebar.jsx
index 71091f12b..29ad60acc 100644
--- a/webapp/components/sidebar.jsx
+++ b/webapp/components/sidebar.jsx
@@ -91,6 +91,7 @@ export default class Sidebar extends React.Component {
const preferences = PreferenceStore.getCategory(Constants.Preferences.CATEGORY_DIRECT_CHANNEL_SHOW);
const directChannels = [];
+ const directNonTeamChannels = [];
for (const [name, value] of preferences) {
if (value !== 'true') {
continue;
@@ -117,10 +118,15 @@ export default class Sidebar extends React.Component {
directChannel.teammate_id = teammateId;
directChannel.status = UserStore.getStatus(teammateId);
- directChannels.push(directChannel);
+ if (UserStore.hasTeamProfile(teammateId)) {
+ directChannels.push(directChannel);
+ } else {
+ directNonTeamChannels.push(directChannel);
+ }
}
directChannels.sort(this.sortChannelsByDisplayName);
+ directNonTeamChannels.sort(this.sortChannelsByDisplayName);
const tutorialStep = PreferenceStore.getInt(Preferences.TUTORIAL_STEP, UserStore.getCurrentId(), 999);
@@ -130,6 +136,7 @@ export default class Sidebar extends React.Component {
publicChannels,
privateChannels,
directChannels,
+ directNonTeamChannels,
unreadCounts: JSON.parse(JSON.stringify(ChannelStore.getUnreadCounts())),
showTutorialTip: tutorialStep === TutorialSteps.CHANNEL_POPOVER,
currentTeam: TeamStore.getCurrent(),
@@ -496,6 +503,15 @@ export default class Sidebar extends React.Component {
return this.createChannelElement(channel, index, arr, this.handleLeaveDirectChannel);
});
+ const directMessageNonTeamItems = this.state.directNonTeamChannels.map((channel, index, arr) => {
+ return this.createChannelElement(channel, index, arr, this.handleLeaveDirectChannel);
+ });
+
+ let directDivider;
+ if (directMessageNonTeamItems.length !== 0) {
+ directDivider = <hr/>;
+ }
+
// update the favicon to show if there are any notifications
if (this.lastBadgesActive !== this.badgesActive) {
var link = document.createElement('link');
@@ -675,6 +691,8 @@ export default class Sidebar extends React.Component {
</h4>
</li>
{directMessageItems}
+ {directDivider}
+ {directMessageNonTeamItems}
{directMessageMore}
</ul>
</div>