aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/SettingsStore.js
diff options
context:
space:
mode:
authorLibravatar Amine Mouafik <amine@mouafik.fr>2019-11-29 19:41:09 +0700
committerLibravatar Amine Mouafik <amine@mouafik.fr>2019-11-29 19:41:09 +0700
commitb3c56428fa8fe15a35b70c5f5ca933ce2c0bba66 (patch)
tree982c30316842530af2f162fca0e5aaba96279b87 /src/stores/SettingsStore.js
parentFix cannot read property 'args' of null (diff)
downloadferdium-app-b3c56428fa8fe15a35b70c5f5ca933ce2c0bba66.tar.gz
ferdium-app-b3c56428fa8fe15a35b70c5f5ca933ce2c0bba66.tar.zst
ferdium-app-b3c56428fa8fe15a35b70c5f5ca933ce2c0bba66.zip
Prevent Password Lock to trigger while not logged in
Diffstat (limited to 'src/stores/SettingsStore.js')
-rw-r--r--src/stores/SettingsStore.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/stores/SettingsStore.js b/src/stores/SettingsStore.js
index df0fc77e9..051e86be2 100644
--- a/src/stores/SettingsStore.js
+++ b/src/stores/SettingsStore.js
@@ -68,7 +68,6 @@ export default class SettingsStore extends Store {
68 () => this.all.app.locked, 68 () => this.all.app.locked,
69 () => { 69 () => {
70 const { router } = window.ferdi.stores; 70 const { router } = window.ferdi.stores;
71
72 if (this.all.app.locked && this.all.app.lockingFeatureEnabled) { 71 if (this.all.app.locked && this.all.app.lockingFeatureEnabled) {
73 // App just got locked, redirect to unlock screen 72 // App just got locked, redirect to unlock screen
74 router.push('/auth/locked'); 73 router.push('/auth/locked');
@@ -82,7 +81,8 @@ export default class SettingsStore extends Store {
82 81
83 // Make sure to lock app on launch if locking feature is enabled 82 // Make sure to lock app on launch if locking feature is enabled
84 setTimeout(() => { 83 setTimeout(() => {
85 if (this.all.app.lockingFeatureEnabled) { 84 const isLoggedIn = Boolean(localStorage.getItem('authToken'));
85 if (isLoggedIn && this.all.app.lockingFeatureEnabled) {
86 // Disable lock first - otherwise the lock might not get activated corrently 86 // Disable lock first - otherwise the lock might not get activated corrently
87 this.actions.settings.update({ 87 this.actions.settings.update({
88 type: 'app', 88 type: 'app',