diff options
-rw-r--r-- | src/stores/SettingsStore.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/stores/SettingsStore.js b/src/stores/SettingsStore.js index 59a99a6e0..feee282e4 100644 --- a/src/stores/SettingsStore.js +++ b/src/stores/SettingsStore.js | |||
@@ -92,7 +92,18 @@ export default class SettingsStore extends Store { | |||
92 | // Lock on startup if enabled in settings | 92 | // Lock on startup if enabled in settings |
93 | if (this.startup && resp.type === 'app' && resp.data.lockingFeatureEnabled) { | 93 | if (this.startup && resp.type === 'app' && resp.data.lockingFeatureEnabled) { |
94 | this.startup = false; | 94 | this.startup = false; |
95 | process.nextTick(() => { this.all.app.locked = true }) | 95 | process.nextTick(() => { |
96 | // If the app was previously closed unlocked | ||
97 | // we can update the `locked` setting and rely on the reaction to lock at startup | ||
98 | if (!this.all.app.locked) { | ||
99 | this.all.app.locked = true; | ||
100 | } else { | ||
101 | // Otherwise the app previously closed in a locked state | ||
102 | // We can't rely on updating the locked setting for the reaction to be triggered | ||
103 | // So we lock manually | ||
104 | window.ferdi.stores.router.push('/auth/locked'); | ||
105 | } | ||
106 | }) | ||
96 | } | 107 | } |
97 | debug('Get appSettings resolves', resp.type, resp.data); | 108 | debug('Get appSettings resolves', resp.type, resp.data); |
98 | Object.assign(this._fileSystemSettingsCache[resp.type], resp.data); | 109 | Object.assign(this._fileSystemSettingsCache[resp.type], resp.data); |