From ef53aa1e7f2233a5c094b6cfdd0b647566b1b75c Mon Sep 17 00:00:00 2001 From: Thomas Hopkins Date: Tue, 1 Nov 2016 09:06:25 -0700 Subject: PLT-4491 Fix navbar title for dm channels on mobile (#4394) --- webapp/components/navbar.jsx | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'webapp') 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) { -- cgit v1.2.3-1-g7c22