Fixing logging errors for Franz (#7273)
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
1f899c873e
Коммит
f9632497a4
@@ -122,33 +122,35 @@ export function notifyMe(title, body, channel, teamId, duration, silent) {
|
|||||||
if (Notification.permission === 'granted' || (Notification.permission === 'default' && !requestedNotificationPermission)) {
|
if (Notification.permission === 'granted' || (Notification.permission === 'default' && !requestedNotificationPermission)) {
|
||||||
requestedNotificationPermission = true;
|
requestedNotificationPermission = true;
|
||||||
|
|
||||||
Notification.requestPermission((permission) => {
|
if (typeof Notification.requestPermission === 'function') {
|
||||||
if (permission === 'granted') {
|
Notification.requestPermission((permission) => {
|
||||||
try {
|
if (permission === 'granted') {
|
||||||
var notification = new Notification(title, {body, tag: body, icon: icon50, requireInteraction: notificationDuration === 0, silent});
|
try {
|
||||||
notification.onclick = () => {
|
var notification = new Notification(title, {body, tag: body, icon: icon50, requireInteraction: notificationDuration === 0, silent});
|
||||||
window.focus();
|
notification.onclick = () => {
|
||||||
if (channel && (channel.type === Constants.DM_CHANNEL || channel.type === Constants.GM_CHANNEL)) {
|
window.focus();
|
||||||
browserHistory.push(TeamStore.getCurrentTeamUrl() + '/channels/' + channel.name);
|
if (channel && (channel.type === Constants.DM_CHANNEL || channel.type === Constants.GM_CHANNEL)) {
|
||||||
} else if (channel) {
|
browserHistory.push(TeamStore.getCurrentTeamUrl() + '/channels/' + channel.name);
|
||||||
browserHistory.push(TeamStore.getTeamUrl(teamId) + '/channels/' + channel.name);
|
} else if (channel) {
|
||||||
} else if (teamId) {
|
browserHistory.push(TeamStore.getTeamUrl(teamId) + '/channels/' + channel.name);
|
||||||
browserHistory.push(TeamStore.getTeamUrl(teamId) + '/channels/town-square');
|
} else if (teamId) {
|
||||||
} else {
|
browserHistory.push(TeamStore.getTeamUrl(teamId) + '/channels/town-square');
|
||||||
browserHistory.push(TeamStore.getCurrentTeamUrl() + '/channels/town-square');
|
} else {
|
||||||
}
|
browserHistory.push(TeamStore.getCurrentTeamUrl() + '/channels/town-square');
|
||||||
};
|
}
|
||||||
|
};
|
||||||
|
|
||||||
if (notificationDuration > 0) {
|
if (notificationDuration > 0) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
notification.close();
|
notification.close();
|
||||||
}, notificationDuration);
|
}, notificationDuration);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e); //eslint-disable-line no-console
|
||||||
}
|
}
|
||||||
} catch (e) {
|
|
||||||
console.error(e); //eslint-disable-line no-console
|
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user