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) {
|
var handleUnreadCountChange = function(count) {
|
||||||
thisObj.handleUnreadCountChange(index, 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 (
|
return (
|
||||||
<Grid fluid>
|
<Grid fluid>
|
||||||
@@ -153,6 +156,8 @@ var MattermostView = React.createClass({
|
|||||||
var unreadCount = event.args[0];
|
var unreadCount = event.args[0];
|
||||||
thisObj.handleUnreadCountChange(unreadCount);
|
thisObj.handleUnreadCountChange(unreadCount);
|
||||||
break;
|
break;
|
||||||
|
case 'onNotificationClick':
|
||||||
|
thisObj.props.onNotificationClick();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -53,6 +53,7 @@ function overrideNotification() {
|
|||||||
Notification.prototype.__defineSetter__('onclick', function(callback) {
|
Notification.prototype.__defineSetter__('onclick', function(callback) {
|
||||||
this.notification.onclick = function() {
|
this.notification.onclick = function() {
|
||||||
electron.remote.getCurrentWindow().show();
|
electron.remote.getCurrentWindow().show();
|
||||||
|
ipc.sendToHost('onNotificationClick');
|
||||||
callback();
|
callback();
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user