summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hopkins <thomchop@users.noreply.github.com>2016-11-01 09:06:25 -0700
committerCorey Hulen <corey@hulen.com>2016-11-01 09:06:25 -0700
commitef53aa1e7f2233a5c094b6cfdd0b647566b1b75c (patch)
treeedd342741e084291225832a5a4e608d86b4b8865
parentaa6cb03b2042ff0f11e7c418ad2535eccc29d218 (diff)
downloadchat-ef53aa1e7f2233a5c094b6cfdd0b647566b1b75c.tar.gz
chat-ef53aa1e7f2233a5c094b6cfdd0b647566b1b75c.tar.bz2
chat-ef53aa1e7f2233a5c094b6cfdd0b647566b1b75c.zip
PLT-4491 Fix navbar title for dm channels on mobile (#4394)
-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) {