From 6e42f5ce7bffca67854170dbc7791338db142183 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 16 May 2019 16:00:16 -0400 Subject: [PATCH] use proper set lock option method --- src/App/Pages/Settings/SettingsPageViewModel.cs | 2 +- src/Core/Abstractions/ILockService.cs | 2 +- src/Core/Services/LockService.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/App/Pages/Settings/SettingsPageViewModel.cs b/src/App/Pages/Settings/SettingsPageViewModel.cs index 720ca484f..3b73236dd 100644 --- a/src/App/Pages/Settings/SettingsPageViewModel.cs +++ b/src/App/Pages/Settings/SettingsPageViewModel.cs @@ -186,7 +186,7 @@ namespace Bit.App.Pages var cleanSelection = selection.Replace("✓ ", string.Empty); var selectionOption = _lockOptions.FirstOrDefault(o => o.Key == cleanSelection); _lockOptionValue = selectionOption.Key; - await _storageService.SaveAsync(Constants.LockOptionKey, selectionOption.Value); + await _lockService.SetLockOptionAsync(selectionOption.Value); BuildList(); } diff --git a/src/Core/Abstractions/ILockService.cs b/src/Core/Abstractions/ILockService.cs index 00e85966a..2504f4d43 100644 --- a/src/Core/Abstractions/ILockService.cs +++ b/src/Core/Abstractions/ILockService.cs @@ -12,6 +12,6 @@ namespace Bit.Core.Abstractions Task IsLockedAsync(); Task> IsPinLockSetAsync(); Task LockAsync(bool allowSoftLock = false); - Task SetLockOptionAsync(int lockOption); + Task SetLockOptionAsync(int? lockOption); } } \ No newline at end of file diff --git a/src/Core/Services/LockService.cs b/src/Core/Services/LockService.cs index 008f36842..e9adfd709 100644 --- a/src/Core/Services/LockService.cs +++ b/src/Core/Services/LockService.cs @@ -121,7 +121,7 @@ namespace Bit.Core.Services // TODO: locked callback? } - public async Task SetLockOptionAsync(int lockOption) + public async Task SetLockOptionAsync(int? lockOption) { await _storageService.SaveAsync(Constants.LockOptionKey, lockOption); await _cryptoService.ToggleKeyAsync();