From 0a2146692c1c53eb75e4b561d66be30aa5819857 Mon Sep 17 00:00:00 2001
From: Yuya Ochiai <yuya0321@gmail.com>
Date: Wed, 12 Oct 2016 22:36:06 +0900
Subject: 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.
---
 webapp/utils/utils.jsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'webapp/utils/utils.jsx')

diff --git a/webapp/utils/utils.jsx b/webapp/utils/utils.jsx
index 73765495c..80f704e69 100644
--- a/webapp/utils/utils.jsx
+++ b/webapp/utils/utils.jsx
@@ -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) {
-- 
cgit v1.2.3-1-g7c22

