aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/SettingsStore.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/stores/SettingsStore.js')
-rw-r--r--src/stores/SettingsStore.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/stores/SettingsStore.js b/src/stores/SettingsStore.js
index ced286052..15b0db120 100644
--- a/src/stores/SettingsStore.js
+++ b/src/stores/SettingsStore.js
@@ -1,4 +1,5 @@
1import { ipcRenderer, remote } from 'electron'; 1import { ipcRenderer } from 'electron';
2import { getCurrentWindow } from '@electron/remote';
2import { 3import {
3 action, computed, observable, reaction, 4 action, computed, observable, reaction,
4} from 'mobx'; 5} from 'mobx';
@@ -41,7 +42,7 @@ export default class SettingsStore extends Store {
41 reaction( 42 reaction(
42 () => this.all.app.autohideMenuBar, 43 () => this.all.app.autohideMenuBar,
43 () => { 44 () => {
44 const currentWindow = remote.getCurrentWindow(); 45 const currentWindow = getCurrentWindow();
45 currentWindow.setMenuBarVisibility(!this.all.app.autohideMenuBar); 46 currentWindow.setMenuBarVisibility(!this.all.app.autohideMenuBar);
46 currentWindow.autoHideMenuBar = this.all.app.autohideMenuBar; 47 currentWindow.autoHideMenuBar = this.all.app.autohideMenuBar;
47 }, 48 },
@@ -61,7 +62,7 @@ export default class SettingsStore extends Store {
61 62
62 // Inactivity lock timer 63 // Inactivity lock timer
63 let inactivityTimer; 64 let inactivityTimer;
64 remote.getCurrentWindow().on('blur', () => { 65 getCurrentWindow().on('blur', () => {
65 if (this.all.app.inactivityLock !== 0) { 66 if (this.all.app.inactivityLock !== 0) {
66 inactivityTimer = setTimeout(() => { 67 inactivityTimer = setTimeout(() => {
67 this.actions.settings.update({ 68 this.actions.settings.update({
@@ -73,7 +74,7 @@ export default class SettingsStore extends Store {
73 }, this.all.app.inactivityLock * 1000 * 60); 74 }, this.all.app.inactivityLock * 1000 * 60);
74 } 75 }
75 }); 76 });
76 remote.getCurrentWindow().on('focus', () => { 77 getCurrentWindow().on('focus', () => {
77 if (inactivityTimer) { 78 if (inactivityTimer) {
78 clearTimeout(inactivityTimer); 79 clearTimeout(inactivityTimer);
79 } 80 }