added lock setting to persist settings page lock action between app restarts

This commit is contained in:
Kyle Spearrin 2016-07-18 19:44:29 -04:00
parent 299411e9a5
commit a9633e1fd1
3 changed files with 3 additions and 1 deletions

View File

@ -175,7 +175,7 @@ namespace Bit.App
} }
// Are we forcing a lock? (i.e. clicking a button to lock the app manually, immediately) // Are we forcing a lock? (i.e. clicking a button to lock the app manually, immediately)
if(!forceLock) if(!forceLock && !_settings.GetValueOrDefault(Constants.SettingLocked, false))
{ {
// Lock seconds tells if if they want to lock the app or not // Lock seconds tells if if they want to lock the app or not
var lockSeconds = _settings.GetValueOrDefault<int?>(Constants.SettingLockSeconds); var lockSeconds = _settings.GetValueOrDefault<int?>(Constants.SettingLockSeconds);

View File

@ -6,6 +6,7 @@
public const string SettingPinUnlockOn = "setting:pinUnlockOn"; public const string SettingPinUnlockOn = "setting:pinUnlockOn";
public const string SettingLockSeconds = "setting:lockSeconds"; public const string SettingLockSeconds = "setting:lockSeconds";
public const string SettingLastBackgroundedDate = "lastBackgroundedDate"; public const string SettingLastBackgroundedDate = "lastBackgroundedDate";
public const string SettingLocked = "locked";
public const string PasswordGeneratorLength = "pwGenerator:length"; public const string PasswordGeneratorLength = "pwGenerator:length";
public const string PasswordGeneratorUppercase = "pwGenerator:uppercase"; public const string PasswordGeneratorUppercase = "pwGenerator:uppercase";

View File

@ -188,6 +188,7 @@ namespace Bit.App.Pages
private void LockCell_Tapped(object sender, EventArgs e) private void LockCell_Tapped(object sender, EventArgs e)
{ {
_settings.AddOrUpdateValue(Constants.SettingLocked, true);
MessagingCenter.Send(Application.Current, "Lock", true); MessagingCenter.Send(Application.Current, "Lock", true);
} }