Skip to content

Commit

Permalink
Fix desktop notification click handler for existing/new GMs (#5633)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwilander authored and grundleborg committed Mar 4, 2017
1 parent 163f591 commit 615d116
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion webapp/stores/notification_store.jsx
Expand Up @@ -71,7 +71,8 @@ class NotificationStoreClass extends EventEmitter {
if (!channel) {
title = msgProps.channel_display_name;
channel = {
name: msgProps.channel_name
name: msgProps.channel_name,
type: msgProps.channel_type
};
} else if (channel.type === Constants.DM_CHANNEL) {
title = Utils.localizeMessage('notification.dm', 'Direct Message');
Expand Down
2 changes: 1 addition & 1 deletion webapp/utils/utils.jsx
Expand Up @@ -104,7 +104,7 @@ export function notifyMe(title, body, channel, teamId, duration, silent) {
var notification = new Notification(title, {body, tag: body, icon: icon50, requireInteraction: notificationDuration === 0, silent});
notification.onclick = () => {
window.focus();
if (channel && channel.type === Constants.DM_CHANNEL) {
if (channel && (channel.type === Constants.DM_CHANNEL || channel.type === Constants.GM_CHANNEL)) {
browserHistory.push(TeamStore.getCurrentTeamUrl() + '/channels/' + channel.name);
} else if (channel) {
browserHistory.push(TeamStore.getTeamUrl(teamId) + '/channels/' + channel.name);
Expand Down

0 comments on commit 615d116

Please sign in to comment.