aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/AppStore.js
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2018-02-16 15:03:36 +0100
committerLibravatar GitHub <noreply@github.com>2018-02-16 15:03:36 +0100
commitd6662400e5f72822ce462f6c17f081db4ea4ac5f (patch)
tree59067a6cd261724607bc46ad1ac56210b23d1d5f /src/stores/AppStore.js
parentMerge branch 'fix/copy-paste' into develop (diff)
parentfix sideeffect of app not launching itself after first launch (diff)
downloadferdium-app-d6662400e5f72822ce462f6c17f081db4ea4ac5f.tar.gz
ferdium-app-d6662400e5f72822ce462f6c17f081db4ea4ac5f.tar.zst
ferdium-app-d6662400e5f72822ce462f6c17f081db4ea4ac5f.zip
fix(App): Fix issues with disabling launch app on startup
Refactor settingsStore to use mobx-localstorage
Diffstat (limited to 'src/stores/AppStore.js')
-rw-r--r--src/stores/AppStore.js10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js
index dc5a04c46..9b59f01d2 100644
--- a/src/stores/AppStore.js
+++ b/src/stores/AppStore.js
@@ -331,10 +331,7 @@ export default class AppStore extends Store {
331 } 331 }
332 332
333 // Helpers 333 // Helpers
334 async _appStartsCounter() { 334 _appStartsCounter() {
335 // we need to wait until the settings request is resolved
336 await this.stores.settings.allSettingsRequest;
337
338 this.actions.settings.update({ 335 this.actions.settings.update({
339 settings: { 336 settings: {
340 appStarts: (this.stores.settings.all.appStarts || 0) + 1, 337 appStarts: (this.stores.settings.all.appStarts || 0) + 1,
@@ -345,10 +342,7 @@ export default class AppStore extends Store {
345 async _autoStart() { 342 async _autoStart() {
346 this.autoLaunchOnStart = await this._checkAutoStart(); 343 this.autoLaunchOnStart = await this._checkAutoStart();
347 344
348 // we need to wait until the settings request is resolved 345 if (this.stores.settings.all.appStarts === 1) {
349 await this.stores.settings.allSettingsRequest;
350
351 if (!this.stores.settings.all.appStarts) {
352 this.actions.app.launchOnStartup({ 346 this.actions.app.launchOnStartup({
353 enable: true, 347 enable: true,
354 }); 348 });