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);
}
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 }
onNotificationClick={ handleNotificationClick } ref={ id } />)
var is_active = thisObj.state.key === index;
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>
{ views }
@ -409,9 +410,11 @@ var MattermostView = React.createClass({
});
webview.addEventListener('page-title-updated', function(event) {
ipcRenderer.send('update-title', {
title: event.title
});
if (thisObj.props.active) {
ipcRenderer.send('update-title', {
title: event.title
});
}
});
webview.addEventListener('console-message', (e) => {