diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/containers/layout/AppLayoutContainer.js | 2 | ||||
-rw-r--r-- | src/stores/AppStore.js | 13 |
2 files changed, 13 insertions, 2 deletions
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 { | |||
81 | <Sidebar | 81 | <Sidebar |
82 | services={allServices} | 82 | services={allServices} |
83 | setActive={setActive} | 83 | setActive={setActive} |
84 | isAppMuted={settings.all.isMuted} | 84 | isAppMuted={app.isSystemMuted || settings.all.isMuted} |
85 | openSettings={openSettings} | 85 | openSettings={openSettings} |
86 | closeSettings={closeSettings} | 86 | closeSettings={closeSettings} |
87 | reorder={reorder} | 87 | reorder={reorder} |
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index 6580157d4..6e196144c 100644 --- a/src/stores/AppStore.js +++ b/src/stores/AppStore.js | |||
@@ -2,7 +2,7 @@ import { remote, ipcRenderer, shell } from 'electron'; | |||
2 | import { action, observable } from 'mobx'; | 2 | import { action, observable } from 'mobx'; |
3 | import moment from 'moment'; | 3 | import moment from 'moment'; |
4 | import key from 'keymaster'; | 4 | import key from 'keymaster'; |
5 | // import path from 'path'; | 5 | import { getDoNotDisturb } from '@meetfranz/electron-notification-state'; |
6 | import idleTimer from '@paulcbetts/system-idle-time'; | 6 | import idleTimer from '@paulcbetts/system-idle-time'; |
7 | import AutoLaunch from 'auto-launch'; | 7 | import AutoLaunch from 'auto-launch'; |
8 | 8 | ||
@@ -45,6 +45,8 @@ export default class AppStore extends Store { | |||
45 | miner = null; | 45 | miner = null; |
46 | @observable minerHashrate = 0.0; | 46 | @observable minerHashrate = 0.0; |
47 | 47 | ||
48 | @observable isSystemMuted = false; | ||
49 | |||
48 | constructor(...args) { | 50 | constructor(...args) { |
49 | super(...args); | 51 | super(...args); |
50 | 52 | ||
@@ -83,6 +85,11 @@ export default class AppStore extends Store { | |||
83 | // Needs to be delayed a bit | 85 | // Needs to be delayed a bit |
84 | this._autoStart(); | 86 | this._autoStart(); |
85 | 87 | ||
88 | // Check if system is muted | ||
89 | // There are no events to subscribe so we need to poll everey 5s | ||
90 | this._systemDND(); | ||
91 | setInterval(() => this._systemDND(), 5000); | ||
92 | |||
86 | // Check for updates once every 4 hours | 93 | // Check for updates once every 4 hours |
87 | setInterval(() => this._checkForUpdates(), CHECK_INTERVAL); | 94 | setInterval(() => this._checkForUpdates(), CHECK_INTERVAL); |
88 | // Check for an update in 30s (need a delay to prevent Squirrel Installer lock file issues) | 95 | // 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 { | |||
311 | async _checkAutoStart() { | 318 | async _checkAutoStart() { |
312 | return autoLauncher.isEnabled() || false; | 319 | return autoLauncher.isEnabled() || false; |
313 | } | 320 | } |
321 | |||
322 | _systemDND() { | ||
323 | this.isSystemMuted = getDoNotDisturb(); | ||
324 | } | ||
314 | } | 325 | } |