aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores
diff options
context:
space:
mode:
authorLibravatar Amine Mouafik <amine@mouafik.fr>2019-09-24 10:55:15 +0700
committerLibravatar Amine Mouafik <amine@mouafik.fr>2019-09-24 10:55:15 +0700
commitd88b04b05b64b6fea38e226c3bf344f58c2ceefb (patch)
tree37d0453f258414f483c2ce27623b12de6ce1b09f /src/stores
parentTrigger pull request build after replugging Travis (diff)
parentAdd darkreader to feature list and changelog (diff)
downloadferdium-app-d88b04b05b64b6fea38e226c3bf344f58c2ceefb.tar.gz
ferdium-app-d88b04b05b64b6fea38e226c3bf344f58c2ceefb.tar.zst
ferdium-app-d88b04b05b64b6fea38e226c3bf344f58c2ceefb.zip
Merge branch 'master' into feat/macos-signing
Diffstat (limited to 'src/stores')
-rw-r--r--src/stores/FeaturesStore.js2
-rw-r--r--src/stores/ServicesStore.js18
2 files changed, 20 insertions, 0 deletions
diff --git a/src/stores/FeaturesStore.js b/src/stores/FeaturesStore.js
index cf28b6bec..c39b6d7f3 100644
--- a/src/stores/FeaturesStore.js
+++ b/src/stores/FeaturesStore.js
@@ -13,6 +13,7 @@ import spellchecker from '../features/spellchecker';
13import serviceProxy from '../features/serviceProxy'; 13import serviceProxy from '../features/serviceProxy';
14import basicAuth from '../features/basicAuth'; 14import basicAuth from '../features/basicAuth';
15import workspaces from '../features/workspaces'; 15import workspaces from '../features/workspaces';
16import quickSwitch from '../features/quickSwitch';
16import shareFranz from '../features/shareFranz'; 17import shareFranz from '../features/shareFranz';
17import announcements from '../features/announcements'; 18import announcements from '../features/announcements';
18import settingsWS from '../features/settingsWS'; 19import settingsWS from '../features/settingsWS';
@@ -75,6 +76,7 @@ export default class FeaturesStore extends Store {
75 serviceProxy(this.stores, this.actions); 76 serviceProxy(this.stores, this.actions);
76 basicAuth(this.stores, this.actions); 77 basicAuth(this.stores, this.actions);
77 workspaces(this.stores, this.actions); 78 workspaces(this.stores, this.actions);
79 quickSwitch(this.stores, this.actions);
78 shareFranz(this.stores, this.actions); 80 shareFranz(this.stores, this.actions);
79 announcements(this.stores, this.actions); 81 announcements(this.stores, this.actions);
80 settingsWS(this.stores, this.actions); 82 settingsWS(this.stores, this.actions);
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,