diff options
Diffstat (limited to 'src/stores/AppStore.js')
-rw-r--r-- | src/stores/AppStore.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index ea1e71bdc..38edff1b4 100644 --- a/src/stores/AppStore.js +++ b/src/stores/AppStore.js | |||
@@ -19,6 +19,8 @@ const debug = require('debug')('AppStore'); | |||
19 | 19 | ||
20 | const { app } = remote; | 20 | const { app } = remote; |
21 | 21 | ||
22 | const mainWindow = remote.getCurrentWindow(); | ||
23 | |||
22 | const defaultLocale = DEFAULT_APP_SETTINGS.locale; | 24 | const defaultLocale = DEFAULT_APP_SETTINGS.locale; |
23 | const autoLauncher = new AutoLaunch({ | 25 | const autoLauncher = new AutoLaunch({ |
24 | name: 'Franz', | 26 | name: 'Franz', |
@@ -50,6 +52,8 @@ export default class AppStore extends Store { | |||
50 | 52 | ||
51 | @observable isClearingAllCache = false; | 53 | @observable isClearingAllCache = false; |
52 | 54 | ||
55 | @observable isFullScreen = mainWindow.isFullScreen(); | ||
56 | |||
53 | constructor(...args) { | 57 | constructor(...args) { |
54 | super(...args); | 58 | super(...args); |
55 | 59 | ||
@@ -82,6 +86,10 @@ export default class AppStore extends Store { | |||
82 | window.addEventListener('online', () => { this.isOnline = true; }); | 86 | window.addEventListener('online', () => { this.isOnline = true; }); |
83 | window.addEventListener('offline', () => { this.isOnline = false; }); | 87 | window.addEventListener('offline', () => { this.isOnline = false; }); |
84 | 88 | ||
89 | mainWindow.on('enter-full-screen', () => { this.isFullScreen = true; }); | ||
90 | mainWindow.on('leave-full-screen', () => { this.isFullScreen = false; }); | ||
91 | |||
92 | |||
85 | this.isOnline = navigator.onLine; | 93 | this.isOnline = navigator.onLine; |
86 | 94 | ||
87 | // Check if Franz should launch on start | 95 | // Check if Franz should launch on start |
@@ -172,8 +180,6 @@ export default class AppStore extends Store { | |||
172 | 180 | ||
173 | this.actions.service.setActive({ serviceId }); | 181 | this.actions.service.setActive({ serviceId }); |
174 | 182 | ||
175 | const mainWindow = remote.getCurrentWindow(); | ||
176 | |||
177 | if (isWindows) { | 183 | if (isWindows) { |
178 | mainWindow.restore(); | 184 | mainWindow.restore(); |
179 | } else if (isLinux) { | 185 | } else if (isLinux) { |