summaryrefslogtreecommitdiffstats
path: root/src/stores/AppStore.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/stores/AppStore.js')
-rw-r--r--src/stores/AppStore.js31
1 files changed, 6 insertions, 25 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js
index 162422017..4ac8325d4 100644
--- a/src/stores/AppStore.js
+++ b/src/stores/AppStore.js
@@ -98,6 +98,10 @@ export default class AppStore extends Store {
98 ipcRenderer.on('autoUpdate', (event, data) => { 98 ipcRenderer.on('autoUpdate', (event, data) => {
99 if (data.available) { 99 if (data.available) {
100 this.updateStatus = this.updateStatusTypes.AVAILABLE; 100 this.updateStatus = this.updateStatusTypes.AVAILABLE;
101
102 if (isMac) {
103 app.dock.bounce();
104 }
101 } 105 }
102 106
103 if (data.available !== undefined && !data.available) { 107 if (data.available !== undefined && !data.available) {
@@ -124,19 +128,6 @@ export default class AppStore extends Store {
124 this.stores.router.push(data.url); 128 this.stores.router.push(data.url);
125 }); 129 });
126 130
127 // Reload all services after a healthy nap
128 // Alternative solution for powerMonitor as the resume event is not fired
129 // More information: https://github.com/electron/electron/issues/1615
130 const TIMEOUT = 5000;
131 let lastTime = (new Date()).getTime();
132 setInterval(() => {
133 const currentTime = (new Date()).getTime();
134 if (currentTime > (lastTime + TIMEOUT + 2000)) {
135 this._reactivateServices();
136 }
137 lastTime = currentTime;
138 }, TIMEOUT);
139
140 // Set active the next service 131 // Set active the next service
141 key( 132 key(
142 '⌘+pagedown, ctrl+pagedown, ⌘+alt+right, ctrl+tab', () => { 133 '⌘+pagedown, ctrl+pagedown, ⌘+alt+right, ctrl+tab', () => {
@@ -244,7 +235,7 @@ export default class AppStore extends Store {
244 } 235 }
245 236
246 @action _muteApp({ isMuted, overrideSystemMute = true }) { 237 @action _muteApp({ isMuted, overrideSystemMute = true }) {
247 this.isSystemMuteOverriden = overrideSystemMute; 238 this.isSystemMuteOverridden = overrideSystemMute;
248 239
249 this.actions.settings.update({ 240 this.actions.settings.update({
250 settings: { 241 settings: {
@@ -356,19 +347,9 @@ export default class AppStore extends Store {
356 return autoLauncher.isEnabled() || false; 347 return autoLauncher.isEnabled() || false;
357 } 348 }
358 349
359 _reactivateServices(retryCount = 0) {
360 if (!this.isOnline) {
361 console.debug('reactivateServices: computer is offline, trying again in 5s, retries:', retryCount);
362 setTimeout(() => this._reactivateServices(retryCount + 1), 5000);
363 } else {
364 console.debug('reactivateServices: reload Franz');
365 window.location.reload();
366 }
367 }
368
369 _systemDND() { 350 _systemDND() {
370 const dnd = getDoNotDisturb(); 351 const dnd = getDoNotDisturb();
371 if (dnd === this.stores.settings.all.isAppMuted || !this.isSystemMuteOverriden) { 352 if (dnd !== this.stores.settings.all.isAppMuted && !this.isSystemMuteOverridden) {
372 this.actions.app.muteApp({ 353 this.actions.app.muteApp({
373 isMuted: dnd, 354 isMuted: dnd,
374 overrideSystemMute: false, 355 overrideSystemMute: false,