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
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user