From 615d116c45923ad4efc4170d150002c599a48fd9 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Sat, 4 Mar 2017 12:58:37 -0500 Subject: [PATCH] Fix desktop notification click handler for existing/new GMs (#5633) --- webapp/stores/notification_store.jsx | 3 ++- webapp/utils/utils.jsx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/webapp/stores/notification_store.jsx b/webapp/stores/notification_store.jsx index 28e5ea65dcb34..f32e710470dd4 100644 --- a/webapp/stores/notification_store.jsx +++ b/webapp/stores/notification_store.jsx @@ -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'); diff --git a/webapp/utils/utils.jsx b/webapp/utils/utils.jsx index 7573eb887257d..384cea7520759 100644 --- a/webapp/utils/utils.jsx +++ b/webapp/utils/utils.jsx @@ -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);