Prevent updating window title by deactivated tabs

This commit is contained in:
Yuya Ochiai
2016-08-20 19:41:23 +09:00
committed by Kolja Lampe
parent f01b6a98f2
commit 8c19c33911

View File

@@ -201,8 +201,9 @@ var MainPage = React.createClass({
thisObj.handleSelect(index); thisObj.handleSelect(index);
} }
var id = 'mattermostView' + index; var id = 'mattermostView' + index;
return (<MattermostView key={ id } id={ id } style={ thisObj.visibleStyle(thisObj.state.key === index) } src={ team.url } name={ team.name } onUnreadCountChange={ handleUnreadCountChange } var is_active = thisObj.state.key === index;
onNotificationClick={ handleNotificationClick } ref={ id } />) return (<MattermostView key={ id } id={ id } style={ thisObj.visibleStyle(is_active) } src={ team.url } name={ team.name } onUnreadCountChange={ handleUnreadCountChange }
onNotificationClick={ handleNotificationClick } ref={ id } active={ is_active } />)
}); });
var views_row = (<Row> var views_row = (<Row>
{ views } { views }
@@ -409,9 +410,11 @@ var MattermostView = React.createClass({
}); });
webview.addEventListener('page-title-updated', function(event) { webview.addEventListener('page-title-updated', function(event) {
if (thisObj.props.active) {
ipcRenderer.send('update-title', { ipcRenderer.send('update-title', {
title: event.title title: event.title
}); });
}
}); });
webview.addEventListener('console-message', (e) => { webview.addEventListener('console-message', (e) => {