diff --git a/CHANGELOG.md b/CHANGELOG.md index 32c34576..5ada5559 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ Release date: TBD ### Improvements #### All platforms +- Show current channel/team in window title - Changed display of unread messages on the team tabbar, they are now shown as bold text - Reload only the selected tab and keep its URL on "Reload" and "Clear Cache and Reload". - Disabled `eval()` function for security improvements. diff --git a/src/browser/index.html b/src/browser/index.html index 74f81b95..9af40a0b 100644 --- a/src/browser/index.html +++ b/src/browser/index.html @@ -3,7 +3,6 @@ - Mattermost diff --git a/src/browser/index.jsx b/src/browser/index.jsx index 07f701dc..08300f5a 100644 --- a/src/browser/index.jsx +++ b/src/browser/index.jsx @@ -94,6 +94,11 @@ var MainPage = React.createClass({ key: newKey }); this.handleOnTeamFocused(key); + + var webview = document.getElementById('mattermostView' + key); + ipcRenderer.send('update-title', { + title: webview.getTitle() + }); }, handleUnreadCountChange: function(index, unreadCount, mentionCount, isUnread, isMentioned) { var unreadCounts = this.state.unreadCounts; @@ -403,6 +408,12 @@ var MattermostView = React.createClass({ } }); + webview.addEventListener('page-title-updated', function(event) { + ipcRenderer.send('update-title', { + title: event.title + }); + }); + webview.addEventListener('console-message', (e) => { const message = `[${this.props.name}] ${e.message}`; switch (e.level) { diff --git a/src/main.js b/src/main.js index b4555909..df4433ac 100644 --- a/src/main.js +++ b/src/main.js @@ -229,6 +229,11 @@ app.on('ready', function() { } } }); + + ipcMain.on('update-title', function(event, arg) { + mainWindow.setTitle(arg.title); + }); + if (shouldShowTrayIcon()) { // set up tray icon trayIcon = new Tray(trayImages.normal);