summaryrefslogtreecommitdiffstats
path: root/webapp/utils/utils.jsx
diff options
context:
space:
mode:
authorYuya Ochiai <yuya0321@gmail.com>2016-10-12 22:36:06 +0900
committerHarrison Healey <harrisonmhealey@gmail.com>2016-10-12 09:36:06 -0400
commit0a2146692c1c53eb75e4b561d66be30aa5819857 (patch)
treec651722bd2d12ad988b059da20912aba016f70e7 /webapp/utils/utils.jsx
parent552508706d5ec4b87e67c0bf46609fb320ee7792 (diff)
downloadchat-0a2146692c1c53eb75e4b561d66be30aa5819857.tar.gz
chat-0a2146692c1c53eb75e4b561d66be30aa5819857.tar.bz2
chat-0a2146692c1c53eb75e4b561d66be30aa5819857.zip
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.
Diffstat (limited to 'webapp/utils/utils.jsx')
-rw-r--r--webapp/utils/utils.jsx4
1 files changed, 2 insertions, 2 deletions
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) {