From f5a9aa21e2ab958f60c143668f4836bc47e2b539 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Fri, 10 Nov 2017 12:08:35 +0100 Subject: feat(App): Add option to mute all services in sidebar Closes #8 #162 --- src/containers/layout/AppLayoutContainer.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/containers/layout') diff --git a/src/containers/layout/AppLayoutContainer.js b/src/containers/layout/AppLayoutContainer.js index 68ad1039e..5ef4fbb35 100644 --- a/src/containers/layout/AppLayoutContainer.js +++ b/src/containers/layout/AppLayoutContainer.js @@ -7,7 +7,7 @@ import RecipesStore from '../../stores/RecipesStore'; import ServicesStore from '../../stores/ServicesStore'; import UIStore from '../../stores/UIStore'; import NewsStore from '../../stores/NewsStore'; -import UserStore from '../../stores/UserStore'; +import SettingsStore from '../../stores/SettingsStore'; import RequestStore from '../../stores/RequestStore'; import GlobalErrorStore from '../../stores/GlobalErrorStore'; @@ -29,8 +29,8 @@ export default class AppLayoutContainer extends Component { services, ui, news, + settings, globalError, - user, requests, } = this.props.stores; @@ -43,6 +43,7 @@ export default class AppLayoutContainer extends Component { reorder, reload, toggleNotifications, + toggleAudio, deleteService, updateService, } = this.props.actions.service; @@ -53,6 +54,7 @@ export default class AppLayoutContainer extends Component { const { installUpdate, + toggleMuteApp, } = this.props.actions.app; const { @@ -79,14 +81,16 @@ export default class AppLayoutContainer extends Component { ); @@ -97,6 +101,7 @@ export default class AppLayoutContainer extends Component { setWebviewReference={setWebviewReference} openWindow={openWindow} reload={reload} + isAppMuted={settings.all.isMuted} /> ); @@ -130,7 +135,7 @@ AppLayoutContainer.wrappedComponent.propTypes = { app: PropTypes.instanceOf(AppStore).isRequired, ui: PropTypes.instanceOf(UIStore).isRequired, news: PropTypes.instanceOf(NewsStore).isRequired, - user: PropTypes.instanceOf(UserStore).isRequired, + settings: PropTypes.instanceOf(SettingsStore).isRequired, requests: PropTypes.instanceOf(RequestStore).isRequired, globalError: PropTypes.instanceOf(GlobalErrorStore).isRequired, }).isRequired, @@ -139,6 +144,7 @@ AppLayoutContainer.wrappedComponent.propTypes = { setActive: PropTypes.func.isRequired, reload: PropTypes.func.isRequired, toggleNotifications: PropTypes.func.isRequired, + toggleAudio: PropTypes.func.isRequired, handleIPCMessage: PropTypes.func.isRequired, setWebviewReference: PropTypes.func.isRequired, openWindow: PropTypes.func.isRequired, @@ -156,7 +162,7 @@ AppLayoutContainer.wrappedComponent.propTypes = { }).isRequired, app: PropTypes.shape({ installUpdate: PropTypes.func.isRequired, - healthCheck: PropTypes.func.isRequired, + toggleMuteApp: PropTypes.func.isRequired, }).isRequired, requests: PropTypes.shape({ retryRequiredRequests: PropTypes.func.isRequired, -- cgit v1.2.3-70-g09d2 From 7d41227cb78bed23fcac4c8b40dcadae57c098bc Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Fri, 10 Nov 2017 14:51:38 +0100 Subject: feat(App): Respect System DoNotDisturb mode for service audio Closes #162 --- package.json | 1 + src/containers/layout/AppLayoutContainer.js | 2 +- src/stores/AppStore.js | 13 ++++++++++- yarn.lock | 35 ++++++++++++++++++++++++++++- 4 files changed, 48 insertions(+), 3 deletions(-) (limited to 'src/containers/layout') diff --git a/package.json b/package.json index 9b56cdf27..f9f6ca91c 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "author": "Stefan Malzner ", "license": "Apache-2.0", "dependencies": { + "@meetfranz/electron-notification-state": "^1.0.0", "@paulcbetts/system-idle-time": "^1.0.4", "address-rfc2822": "^2.0.1", "auto-launch": "https://github.com/meetfranz/node-auto-launch.git", diff --git a/src/containers/layout/AppLayoutContainer.js b/src/containers/layout/AppLayoutContainer.js index 5ef4fbb35..28b6a105f 100644 --- a/src/containers/layout/AppLayoutContainer.js +++ b/src/containers/layout/AppLayoutContainer.js @@ -81,7 +81,7 @@ export default class AppLayoutContainer extends Component { this._systemDND(), 5000); + // Check for updates once every 4 hours setInterval(() => this._checkForUpdates(), CHECK_INTERVAL); // Check for an update in 30s (need a delay to prevent Squirrel Installer lock file issues) @@ -311,4 +318,8 @@ export default class AppStore extends Store { async _checkAutoStart() { return autoLauncher.isEnabled() || false; } + + _systemDND() { + this.isSystemMuted = getDoNotDisturb(); + } } diff --git a/yarn.lock b/yarn.lock index 0bedbac27..6c3f807a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -22,6 +22,14 @@ "7zip-bin-mac" "^1.0.1" "7zip-bin-win" "^2.1.0" +"@meetfranz/electron-notification-state@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@meetfranz/electron-notification-state/-/electron-notification-state-1.0.0.tgz#75e9d774bdaf15991eacd92cde8469b348259d8c" + dependencies: + macos-notification-state "^1.1.0" + windows-notification-state "^1.3.0" + windows-quiet-hours "^1.2.2" + "@paulcbetts/cld@^2.4.6": version "2.4.6" resolved "https://registry.yarnpkg.com/@paulcbetts/cld/-/cld-2.4.6.tgz#a992f6bc43cab212ac2c4488a671cf302f8b62e7" @@ -1168,6 +1176,10 @@ binary@^0.3.0: buffers "~0.1.1" chainsaw "~0.1.0" +bindings@^1.2.1, bindings@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.3.0.tgz#b346f6ecf6a95f5a815c5839fc7cdb22502f1ed7" + bindings@~1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.2.1.tgz#14ad6113812d2d37d72e67b4cacb4bb726505f11" @@ -4012,6 +4024,13 @@ macaddress@^0.2.7: version "0.2.8" resolved "https://registry.yarnpkg.com/macaddress/-/macaddress-0.2.8.tgz#5904dc537c39ec6dbefeae902327135fa8511f12" +macos-notification-state@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/macos-notification-state/-/macos-notification-state-1.1.0.tgz#ee59671e05c1ec388c0b09101ef611c85b4b4e0e" + dependencies: + bindings "^1.2.1" + nan "^2.4.0" + make-dir@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.0.0.tgz#97a011751e91dd87cfadef58832ebb04936de978" @@ -4243,7 +4262,7 @@ mute-stream@0.0.7, mute-stream@~0.0.4: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" -nan@^2.0.0, nan@^2.0.5, nan@^2.3.0, nan@^2.3.2: +nan@^2.0.0, nan@^2.0.5, nan@^2.3.0, nan@^2.3.2, nan@^2.4.0, nan@^2.7.0: version "2.7.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.7.0.tgz#d95bf721ec877e08db276ed3fc6eb78f9083ad46" @@ -6155,6 +6174,20 @@ window-size@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" +windows-notification-state@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/windows-notification-state/-/windows-notification-state-1.3.0.tgz#9f727782ecac8d920a408f1026be6f8e08fd902e" + dependencies: + bindings "^1.2.1" + nan "^2.4.0" + +windows-quiet-hours@^1.2.2: + version "1.2.4" + resolved "https://registry.yarnpkg.com/windows-quiet-hours/-/windows-quiet-hours-1.2.4.tgz#7ae57b13fe9423f2635ac0ed5791f674401a7c7a" + dependencies: + bindings "^1.3.0" + nan "^2.7.0" + winreg@1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/winreg/-/winreg-1.2.2.tgz#8509afa3b71c5bbd110a6d7c6247ec67736c598f" -- cgit v1.2.3-70-g09d2 From fb0b38228fd743079ffc6180f45ddaebaa3f3255 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Fri, 10 Nov 2017 21:41:20 +0100 Subject: fix undefined prop for isAppMuted --- src/containers/layout/AppLayoutContainer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/containers/layout') diff --git a/src/containers/layout/AppLayoutContainer.js b/src/containers/layout/AppLayoutContainer.js index 1b0f4d495..8e5b3d2ed 100644 --- a/src/containers/layout/AppLayoutContainer.js +++ b/src/containers/layout/AppLayoutContainer.js @@ -80,7 +80,7 @@ export default class AppLayoutContainer extends Component { ); -- cgit v1.2.3-70-g09d2