summaryrefslogtreecommitdiffstats
path: root/web/react/components/sidebar.jsx
diff options
context:
space:
mode:
authorReed Garmsen <rgarmsen2295@gmail.com>2015-09-28 14:58:14 -0700
committerReed Garmsen <rgarmsen2295@gmail.com>2015-09-28 15:13:10 -0700
commit5b67abf34bccee1425b980675865319eb3c7602c (patch)
tree841a7acb00eb4330fe19cfdbb11d8ea3268dd337 /web/react/components/sidebar.jsx
parentd70aec1f76be45e067622894856efcd962c0f5fd (diff)
downloadchat-5b67abf34bccee1425b980675865319eb3c7602c.tar.gz
chat-5b67abf34bccee1425b980675865319eb3c7602c.tar.bz2
chat-5b67abf34bccee1425b980675865319eb3c7602c.zip
Better parsing of the website's title when viewing a channel
Diffstat (limited to 'web/react/components/sidebar.jsx')
-rw-r--r--web/react/components/sidebar.jsx15
1 files changed, 10 insertions, 5 deletions
diff --git a/web/react/components/sidebar.jsx b/web/react/components/sidebar.jsx
index 14664ed4d..6033f200f 100644
--- a/web/react/components/sidebar.jsx
+++ b/web/react/components/sidebar.jsx
@@ -268,14 +268,19 @@ export default class Sidebar extends React.Component {
}
}
updateTitle() {
- var channel = ChannelStore.getCurrent();
+ const channel = ChannelStore.getCurrent();
if (channel) {
+ let currentSiteName = '';
+ if (global.window.config.SiteName != null) {
+ currentSiteName = global.window.config.SiteName;
+ }
+
+ let currentChannelName = channel.display_name;
if (channel.type === 'D') {
- var teammateUsername = Utils.getDirectTeammate(channel.id).username;
- document.title = teammateUsername + ' ' + document.title.substring(document.title.lastIndexOf('-'));
- } else {
- document.title = channel.display_name + ' ' + document.title.substring(document.title.lastIndexOf('-'));
+ currentChannelName = Utils.getDirectTeammate(channel.id).username;
}
+
+ document.title = currentChannelName + ' - ' + this.props.teamDisplayName + ' ' + currentSiteName;
}
}
onScroll() {