summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
Diffstat (limited to 'webapp')
-rw-r--r--webapp/components/navbar.jsx13
1 files changed, 2 insertions, 11 deletions
diff --git a/webapp/components/navbar.jsx b/webapp/components/navbar.jsx
index 4a06d8914..9852e0c59 100644
--- a/webapp/components/navbar.jsx
+++ b/webapp/components/navbar.jsx
@@ -688,17 +688,8 @@ export default class Navbar extends React.Component {
channelTitle = channel.display_name;
} else if (channel.type === 'D') {
isDirect = true;
- if (this.state.users.length > 1) {
- let p;
- if (this.state.users[0].id === currentId) {
- p = UserStore.getProfile(this.state.users[1].id);
- } else {
- p = UserStore.getProfile(this.state.users[0].id);
- }
- if (p != null) {
- channelTitle = p.username;
- }
- }
+ const teammateId = Utils.getUserIdFromChannelName(channel);
+ channelTitle = Utils.displayUsername(teammateId);
}
if (channel.header.length === 0) {