aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/ServicesStore.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/stores/ServicesStore.js')
-rw-r--r--src/stores/ServicesStore.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js
index f88b14983..3173004d4 100644
--- a/src/stores/ServicesStore.js
+++ b/src/stores/ServicesStore.js
@@ -11,6 +11,7 @@ import Store from './lib/Store';
11import Request from './lib/Request'; 11import Request from './lib/Request';
12import CachedRequest from './lib/CachedRequest'; 12import CachedRequest from './lib/CachedRequest';
13import { matchRoute } from '../helpers/routing-helpers'; 13import { matchRoute } from '../helpers/routing-helpers';
14import { isInTimeframe } from '../helpers/schedule-helpers';
14import { workspaceStore } from '../features/workspaces'; 15import { workspaceStore } from '../features/workspaces';
15import { serviceLimitStore } from '../features/serviceLimit'; 16import { serviceLimitStore } from '../features/serviceLimit';
16import { RESTRICTION_TYPES } from '../models/Service'; 17import { RESTRICTION_TYPES } from '../models/Service';
@@ -95,6 +96,11 @@ export default class ServicesStore extends Store {
95 () => this.stores.settings.app.spellcheckerLanguage, 96 () => this.stores.settings.app.spellcheckerLanguage,
96 () => this._shareSettingsWithServiceProcess(), 97 () => this._shareSettingsWithServiceProcess(),
97 ); 98 );
99
100 reaction(
101 () => this.stores.settings.app.darkMode,
102 () => this._shareSettingsWithServiceProcess(),
103 );
98 } 104 }
99 105
100 @computed get all() { 106 @computed get all() {
@@ -422,6 +428,18 @@ export default class ServicesStore extends Store {
422 }); 428 });
423 } else if (channel === 'notification') { 429 } else if (channel === 'notification') {
424 const { options } = args[0]; 430 const { options } = args[0];
431
432 // Check if we are in scheduled Do-not-Disturb time
433 const {
434 scheduledDNDEnabled,
435 scheduledDNDStart,
436 scheduledDNDEnd,
437 } = this.stores.settings.all.app;
438
439 if (scheduledDNDEnabled && isInTimeframe(scheduledDNDStart, scheduledDNDEnd)) {
440 return;
441 }
442
425 if (service.recipe.hasNotificationSound || service.isMuted || this.stores.settings.all.app.isAppMuted) { 443 if (service.recipe.hasNotificationSound || service.isMuted || this.stores.settings.all.app.isAppMuted) {
426 Object.assign(options, { 444 Object.assign(options, {
427 silent: true, 445 silent: true,