From b479acc0a7d2aa06d8adc7a030691447a36e9cfb Mon Sep 17 00:00:00 2001 From: Bennett Date: Fri, 1 May 2020 12:49:22 +0200 Subject: Refactor locking feature (#693) --- src/stores/SettingsStore.js | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'src/stores/SettingsStore.js') diff --git a/src/stores/SettingsStore.js b/src/stores/SettingsStore.js index 227eb2145..dcf3c3b9d 100644 --- a/src/stores/SettingsStore.js +++ b/src/stores/SettingsStore.js @@ -56,21 +56,6 @@ export default class SettingsStore extends Store { }, ); - reaction( - () => this.all.app.locked, - () => { - const { router } = window.ferdi.stores; - if (this.all.app.locked && this.all.app.lockingFeatureEnabled) { - // App just got locked, redirect to unlock screen - router.push('/auth/locked'); - } else if (router.location.pathname.includes('/auth/locked')) { - // App is unlocked but user is still on locked screen - // Redirect to homepage - router.push('/'); - } - }, - ); - // Inactivity lock timer let inactivityTimer; remote.getCurrentWindow().on('blur', () => { @@ -96,15 +81,8 @@ export default class SettingsStore extends Store { if (this.startup && resp.type === 'app' && resp.data.lockingFeatureEnabled) { this.startup = false; process.nextTick(() => { - // If the app was previously closed unlocked - // we can update the `locked` setting and rely on the reaction to lock at startup if (!this.all.app.locked) { this.all.app.locked = true; - } else { - // Otherwise the app previously closed in a locked state - // We can't rely on updating the locked setting for the reaction to be triggered - // So we lock manually - window.ferdi.stores.router.push('/auth/locked'); } }); } -- cgit v1.2.3-54-g00ecf