PLT-4261 Set silent parameter for Notification (#4192)
In the desktop app, there are two kinds of sound on notifications, `Utils.ding()` and `new Notification()` on Windows and Mac. This commit stops both if the account setting is set to off.
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
552508706d
Коммит
0a2146692c
@@ -20,6 +20,8 @@ Edge:
|
||||
Desktop App:
|
||||
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Mattermost/1.2.1 Chrome/49.0.2623.75 Electron/0.37.8 Safari/537.36
|
||||
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586
|
||||
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Mattermost/3.4.1 Chrome/53.0.2785.113 Electron/1.4.2 Safari/537.36
|
||||
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Mattermost/3.4.1 Chrome/51.0.2704.106 Electron/1.2.8 Safari/537.36
|
||||
|
||||
Android Chrome:
|
||||
Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19
|
||||
@@ -98,4 +100,16 @@ export function isInternetExplorer() {
|
||||
|
||||
export function isEdge() {
|
||||
return userAgent.indexOf('Edge') !== -1;
|
||||
}
|
||||
}
|
||||
|
||||
export function isDesktopApp() {
|
||||
return userAgent.indexOf('Mattermost') !== -1 && userAgent.indexOf('Electron') !== -1;
|
||||
}
|
||||
|
||||
export function isWindowsApp() {
|
||||
return isDesktopApp() && userAgent.indexOf('Windows') !== -1;
|
||||
}
|
||||
|
||||
export function isMacApp() {
|
||||
return isDesktopApp() && userAgent.indexOf('Macintosh') !== -1;
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ export function getCookie(name) {
|
||||
|
||||
var requestedNotificationPermission = false;
|
||||
|
||||
export function notifyMe(title, body, channel, teamId, duration) {
|
||||
export function notifyMe(title, body, channel, teamId, duration, silent) {
|
||||
if (!('Notification' in window)) {
|
||||
return;
|
||||
}
|
||||
@@ -102,7 +102,7 @@ export function notifyMe(title, body, channel, teamId, duration) {
|
||||
Notification.requestPermission((permission) => {
|
||||
if (permission === 'granted') {
|
||||
try {
|
||||
var notification = new Notification(title, {body, tag: body, icon: icon50, requireInteraction: notificationDuration === 0});
|
||||
var notification = new Notification(title, {body, tag: body, icon: icon50, requireInteraction: notificationDuration === 0, silent});
|
||||
notification.onclick = () => {
|
||||
window.focus();
|
||||
if (channel) {
|
||||
|
||||
Ссылка в новой задаче
Block a user