diff --git a/src/App/Services/LockService.cs b/src/App/Services/LockService.cs index 2439e5005..700cb36e1 100644 --- a/src/App/Services/LockService.cs +++ b/src/App/Services/LockService.cs @@ -18,7 +18,7 @@ namespace Bit.App.Services private readonly IAuthService _authService; private readonly IFingerprint _fingerprint; private bool _timerCreated = false; - private bool _firstLockCheck = true; + private bool _firstLockCheck = false; // TODO: true when we want to support this public LockService( ISettings settings, @@ -56,11 +56,12 @@ namespace Bit.App.Services return LockType.None; } + // Lock seconds tells if they want to lock the app or not + var lockSeconds = _settings.GetValueOrDefault(Constants.SettingLockSeconds, 60 * 15); + // Are we forcing a lock? (i.e. clicking a button to lock the app manually, immediately) if(!firstlockCheck && !forceLock && !_appSettings.Locked) { - // Lock seconds tells if they want to lock the app or not - var lockSeconds = _settings.GetValueOrDefault(Constants.SettingLockSeconds, 60 * 15); if(lockSeconds == -1) { return LockType.None; @@ -74,6 +75,12 @@ namespace Bit.App.Services } } + // Skip first lock check if not using locking + if(firstlockCheck && lockSeconds == -1 && !forceLock && !_appSettings.Locked) + { + return LockType.None; + } + // What method are we using to unlock? var fingerprintUnlock = _settings.GetValueOrDefault(Constants.SettingFingerprintUnlockOn, false); var pinUnlock = _settings.GetValueOrDefault(Constants.SettingPinUnlockOn, false);