summaryrefslogtreecommitdiffstats
path: root/webapp/stores/notification_store.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/stores/notification_store.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/stores/notification_store.jsx')
-rw-r--r--webapp/stores/notification_store.jsx6
1 files changed, 4 insertions, 2 deletions
diff --git a/webapp/stores/notification_store.jsx b/webapp/stores/notification_store.jsx
index 917b86df8..02826d586 100644
--- a/webapp/stores/notification_store.jsx
+++ b/webapp/stores/notification_store.jsx
@@ -7,6 +7,7 @@ import Constants from 'utils/constants.jsx';
import UserStore from './user_store.jsx';
import ChannelStore from './channel_store.jsx';
import PreferenceStore from './preference_store.jsx';
+import * as UserAgent from 'utils/user_agent.jsx';
import * as Utils from 'utils/utils.jsx';
import * as PostUtils from 'utils/post_utils.jsx';
const ActionTypes = Constants.ActionTypes;
@@ -97,9 +98,10 @@ class NotificationStoreClass extends EventEmitter {
duration = parseInt(user.notify_props.desktop_duration, 10) * 1000;
}
- Utils.notifyMe(title, body, channel, teamId, duration);
+ const sound = !user.notify_props || user.notify_props.desktop_sound === 'true';
+ Utils.notifyMe(title, body, channel, teamId, duration, !sound);
- if (!user.notify_props || user.notify_props.desktop_sound === 'true') {
+ if (sound && !UserAgent.isWindowsApp() && !UserAgent.isMacApp()) {
Utils.ding();
}
}