Fix desktop notification click handler for existing/new GMs (#5633)

Этот коммит содержится в:
Joram Wilander
2017-03-04 12:58:37 -05:00
коммит произвёл George Goldberg
родитель 163f591b7b
Коммит 615d116c45
2 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@@ -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');

Просмотреть файл

@@ -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);