aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/AppStore.js
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2017-11-30 00:12:16 +0100
committerLibravatar Stefan Malzner <stefan@adlk.io>2017-11-30 00:12:16 +0100
commit3045b47d869da4e62e9403c63652baeb7b349e1d (patch)
treeae579477cd09b4683b78eb473ebc7abbb88ffc20 /src/stores/AppStore.js
parentfix(App): App mute now disables notifications as well (diff)
downloadferdium-app-3045b47d869da4e62e9403c63652baeb7b349e1d.tar.gz
ferdium-app-3045b47d869da4e62e9403c63652baeb7b349e1d.tar.zst
ferdium-app-3045b47d869da4e62e9403c63652baeb7b349e1d.zip
fix(App): Allow to turn on notifications when system dnd is enabled
Diffstat (limited to 'src/stores/AppStore.js')
-rw-r--r--src/stores/AppStore.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js
index 71b41e499..0cfe08a28 100644
--- a/src/stores/AppStore.js
+++ b/src/stores/AppStore.js
@@ -45,7 +45,7 @@ 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; 48 @observable isSystemMuteOverridden = false;
49 49
50 constructor(...args) { 50 constructor(...args) {
51 super(...args); 51 super(...args);
@@ -219,7 +219,9 @@ export default class AppStore extends Store {
219 this.healthCheckRequest.execute(); 219 this.healthCheckRequest.execute();
220 } 220 }
221 221
222 @action _muteApp({ isMuted }) { 222 @action _muteApp({ isMuted, overrideSystemMute = true }) {
223 this.isSystemMuteOverriden = overrideSystemMute;
224
223 this.actions.settings.update({ 225 this.actions.settings.update({
224 settings: { 226 settings: {
225 isAppMuted: isMuted, 227 isAppMuted: isMuted,
@@ -328,6 +330,12 @@ export default class AppStore extends Store {
328 } 330 }
329 331
330 _systemDND() { 332 _systemDND() {
331 this.isSystemMuted = getDoNotDisturb(); 333 const dnd = getDoNotDisturb();
334 if (dnd === this.stores.settings.all.isAppMuted || !this.isSystemMuteOverriden) {
335 this.actions.app.muteApp({
336 isMuted: dnd,
337 overrideSystemMute: false,
338 });
339 }
332 } 340 }
333} 341}