Switch to the team when notification is clicked
This commit is contained in:
@@ -72,7 +72,10 @@ var MainPage = React.createClass({
|
||||
var handleUnreadCountChange = function(count) {
|
||||
thisObj.handleUnreadCountChange(index, count);
|
||||
};
|
||||
return (<MattermostView style={ thisObj.visibleStyle(thisObj.state.key === index) } src={ team.url } onUnreadCountChange={ handleUnreadCountChange } />)
|
||||
var handleNotificationClick = function() {
|
||||
thisObj.handleSelect(index);
|
||||
}
|
||||
return (<MattermostView style={ thisObj.visibleStyle(thisObj.state.key === index) } src={ team.url } onUnreadCountChange={ handleUnreadCountChange } onNotificationClick={ handleNotificationClick } />)
|
||||
});
|
||||
return (
|
||||
<Grid fluid>
|
||||
@@ -153,6 +156,8 @@ var MattermostView = React.createClass({
|
||||
var unreadCount = event.args[0];
|
||||
thisObj.handleUnreadCountChange(unreadCount);
|
||||
break;
|
||||
case 'onNotificationClick':
|
||||
thisObj.props.onNotificationClick();
|
||||
}
|
||||
});
|
||||
|
||||
|
@@ -53,6 +53,7 @@ function overrideNotification() {
|
||||
Notification.prototype.__defineSetter__('onclick', function(callback) {
|
||||
this.notification.onclick = function() {
|
||||
electron.remote.getCurrentWindow().show();
|
||||
ipc.sendToHost('onNotificationClick');
|
||||
callback();
|
||||
};
|
||||
});
|
||||
|
Reference in New Issue
Block a user