From 0fa1cafeae39c00a9102a1a1d83a422d600a80d0 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Wed, 29 Nov 2017 21:27:26 +0100 Subject: fix(App): App mute now disables notifications as well --- src/components/layout/Sidebar.js | 8 ++++---- src/i18n/locales/en-US.json | 4 ++-- src/stores/AppStore.js | 2 ++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/layout/Sidebar.js b/src/components/layout/Sidebar.js index cb2ecc8ce..915ebeace 100644 --- a/src/components/layout/Sidebar.js +++ b/src/components/layout/Sidebar.js @@ -17,12 +17,12 @@ const messages = defineMessages({ defaultMessage: '!!!Add new service', }, mute: { - id: 'sidebar.mute', - defaultMessage: '!!!Disable audio', + id: 'sidebar.muteApp', + defaultMessage: '!!!Disable notifications & audio', }, unmute: { - id: 'sidebar.unmute', - defaultMessage: '!!!Enable audio', + id: 'sidebar.unmuteApp', + defaultMessage: '!!!Enable notifications & audio', }, }); diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index 308ec8432..37034d4e1 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json @@ -62,8 +62,8 @@ "infobar.requiredRequestsFailed": "Could not load services and user information", "sidebar.settings": "Settings", "sidebar.addNewService": "Add new service", - "sidebar.mute": "Disable audio", - "sidebar.unmute": "Enable audio", + "sidebar.muteApp": "Disable notifications & audio", + "sidebar.unmuteApp": "Enable notifications & audio", "services.welcome": "Welcome to Franz", "services.getStarted": "Get started", "settings.account.headline": "Account", diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index 0b7c60bce..71b41e499 100644 --- a/src/stores/AppStore.js +++ b/src/stores/AppStore.js @@ -150,6 +150,8 @@ export default class AppStore extends Store { // Actions @action _notify({ title, options, notificationId, serviceId = null }) { + if (this.stores.settings.all.isAppMuted) return; + const notification = new window.Notification(title, options); notification.onclick = (e) => { if (serviceId) { -- cgit v1.2.3-54-g00ecf