use proper set lock option method

This commit is contained in:
Kyle Spearrin 2019-05-16 16:00:16 -04:00
parent c5bd59e52c
commit 6e42f5ce7b
3 changed files with 3 additions and 3 deletions

View file

@ -186,7 +186,7 @@ namespace Bit.App.Pages
var cleanSelection = selection.Replace("✓ ", string.Empty); var cleanSelection = selection.Replace("✓ ", string.Empty);
var selectionOption = _lockOptions.FirstOrDefault(o => o.Key == cleanSelection); var selectionOption = _lockOptions.FirstOrDefault(o => o.Key == cleanSelection);
_lockOptionValue = selectionOption.Key; _lockOptionValue = selectionOption.Key;
await _storageService.SaveAsync(Constants.LockOptionKey, selectionOption.Value); await _lockService.SetLockOptionAsync(selectionOption.Value);
BuildList(); BuildList();
} }

View file

@ -12,6 +12,6 @@ namespace Bit.Core.Abstractions
Task<bool> IsLockedAsync(); Task<bool> IsLockedAsync();
Task<Tuple<bool, bool>> IsPinLockSetAsync(); Task<Tuple<bool, bool>> IsPinLockSetAsync();
Task LockAsync(bool allowSoftLock = false); Task LockAsync(bool allowSoftLock = false);
Task SetLockOptionAsync(int lockOption); Task SetLockOptionAsync(int? lockOption);
} }
} }

View file

@ -121,7 +121,7 @@ namespace Bit.Core.Services
// TODO: locked callback? // TODO: locked callback?
} }
public async Task SetLockOptionAsync(int lockOption) public async Task SetLockOptionAsync(int? lockOption)
{ {
await _storageService.SaveAsync(Constants.LockOptionKey, lockOption); await _storageService.SaveAsync(Constants.LockOptionKey, lockOption);
await _cryptoService.ToggleKeyAsync(); await _cryptoService.ToggleKeyAsync();