summaryrefslogtreecommitdiffstats
path: root/src/stores/ServicesStore.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/stores/ServicesStore.js')
-rw-r--r--src/stores/ServicesStore.js19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js
index 6c41c22cf..269cd1526 100644
--- a/src/stores/ServicesStore.js
+++ b/src/stores/ServicesStore.js
@@ -48,6 +48,7 @@ export default class ServicesStore extends Store {
48 this.actions.service.reloadUpdatedServices.listen(this._reloadUpdatedServices.bind(this)); 48 this.actions.service.reloadUpdatedServices.listen(this._reloadUpdatedServices.bind(this));
49 this.actions.service.reorder.listen(this._reorder.bind(this)); 49 this.actions.service.reorder.listen(this._reorder.bind(this));
50 this.actions.service.toggleNotifications.listen(this._toggleNotifications.bind(this)); 50 this.actions.service.toggleNotifications.listen(this._toggleNotifications.bind(this));
51 this.actions.service.toggleAudio.listen(this._toggleAudio.bind(this));
51 this.actions.service.openDevTools.listen(this._openDevTools.bind(this)); 52 this.actions.service.openDevTools.listen(this._openDevTools.bind(this));
52 this.actions.service.openDevToolsForActiveService.listen(this._openDevToolsForActiveService.bind(this)); 53 this.actions.service.openDevToolsForActiveService.listen(this._openDevToolsForActiveService.bind(this));
53 54
@@ -293,7 +294,7 @@ export default class ServicesStore extends Store {
293 }); 294 });
294 } else if (channel === 'notification') { 295 } else if (channel === 'notification') {
295 const options = args[0].options; 296 const options = args[0].options;
296 if (service.recipe.hasNotificationSound) { 297 if (service.recipe.hasNotificationSound || service.isMuted) {
297 Object.assign(options, { 298 Object.assign(options, {
298 silent: true, 299 silent: true,
299 }); 300 });
@@ -405,11 +406,25 @@ export default class ServicesStore extends Store {
405 @action _toggleNotifications({ serviceId }) { 406 @action _toggleNotifications({ serviceId }) {
406 const service = this.one(serviceId); 407 const service = this.one(serviceId);
407 408
409 this.actions.service.updateService({
410 serviceId,
411 serviceData: {
412 isNotificationEnabled: !service.isNotificationEnabled,
413 },
414 redirect: false,
415 });
416 }
417
418 @action _toggleAudio({ serviceId }) {
419 const service = this.one(serviceId);
420
408 service.isNotificationEnabled = !service.isNotificationEnabled; 421 service.isNotificationEnabled = !service.isNotificationEnabled;
409 422
410 this.actions.service.updateService({ 423 this.actions.service.updateService({
411 serviceId, 424 serviceId,
412 serviceData: service, 425 serviceData: {
426 isMuted: !service.isMuted,
427 },
413 redirect: false, 428 redirect: false,
414 }); 429 });
415 } 430 }