diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-04-04 15:20:55 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2017-04-04 15:20:55 -0400 |
commit | 3e6372b3d49ab9b0220c88aa0cc044e5ceaef9de (patch) | |
tree | cc83d54b3b1cd95a7e5d6c6d198e49ebb9f1622d | |
parent | 97de1d0982ddb4818f5e41527f4d7da2234e829f (diff) | |
download | chat-3e6372b3d49ab9b0220c88aa0cc044e5ceaef9de.tar.gz chat-3e6372b3d49ab9b0220c88aa0cc044e5ceaef9de.tar.bz2 chat-3e6372b3d49ab9b0220c88aa0cc044e5ceaef9de.zip |
Fix title in RHS for pinned posts (#5976)
-rw-r--r-- | webapp/components/sidebar_right.jsx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/webapp/components/sidebar_right.jsx b/webapp/components/sidebar_right.jsx index 6a0716ce1..3f3bacb05 100644 --- a/webapp/components/sidebar_right.jsx +++ b/webapp/components/sidebar_right.jsx @@ -196,6 +196,17 @@ export default class SidebarRight extends React.Component { searchForm = <SearchBox isFocus={this.state.searchVisible && Utils.isMobile()}/>; } + const channel = this.props.channel; + + let channelDisplayName = ''; + if (channel) { + if (channel.type === Constants.DM_CHANNEL || channel.type === Constants.GM_CHANNEL) { + channelDisplayName = Utils.localizeMessage('rhs_root.direct', 'Direct Message'); + } else { + channelDisplayName = channel.display_name; + } + } + if (this.state.searchVisible) { content = ( <div className='sidebar--right__content'> @@ -207,7 +218,7 @@ export default class SidebarRight extends React.Component { useMilitaryTime={this.state.useMilitaryTime} toggleSize={this.toggleSize} shrink={this.onShrink} - channelDisplayName={this.props.channel ? this.props.channel.display_name : ''} + channelDisplayName={channelDisplayName} /> </div> ); |