From 33b4c1e5fa00d365709572cb58a41c2480231368 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Fri, 14 Dec 2018 23:24:54 +0100 Subject: fix(App): Fix notification sounds when app or services are muted Closes #1184 #900 #460 #1049 --- src/stores/ServicesStore.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/stores/ServicesStore.js') diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js index 5b70ca271..a618da547 100644 --- a/src/stores/ServicesStore.js +++ b/src/stores/ServicesStore.js @@ -67,6 +67,7 @@ export default class ServicesStore extends Store { this._mapActiveServiceToServiceModelReaction.bind(this), this._saveActiveService.bind(this), this._logoutReaction.bind(this), + this._handleMuteSettings.bind(this), ]); // Just bind this @@ -615,6 +616,20 @@ export default class ServicesStore extends Store { } } + _handleMuteSettings() { + const { enabled } = this; + const { isAppMuted } = this.stores.settings.app; + + enabled.forEach((service) => { + const { isAttached } = service; + const isMuted = isAppMuted || service.isMuted; + + if (isAttached) { + service.webview.setAudioMuted(isMuted); + } + }); + } + _shareSettingsWithServiceProcess() { const settings = this.stores.settings.app; this.actions.service.sendIPCMessageToAllServices({ -- cgit v1.2.3-54-g00ecf