From 060e1a822f40364cbf7083c2f2d7d45b197fe3e5 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 7 Jun 2019 10:12:11 -0400 Subject: [PATCH] only prompt fingerprint if set --- src/App/Pages/Accounts/LockPage.xaml.cs | 11 +++++---- src/App/Pages/Accounts/LockPageViewModel.cs | 26 ++++++++++++--------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/App/Pages/Accounts/LockPage.xaml.cs b/src/App/Pages/Accounts/LockPage.xaml.cs index b6d90e2e6..36d5c00d2 100644 --- a/src/App/Pages/Accounts/LockPage.xaml.cs +++ b/src/App/Pages/Accounts/LockPage.xaml.cs @@ -47,11 +47,14 @@ namespace Bit.App.Pages public async Task PromptFingerprintAfterResumeAsync() { - await Task.Delay(500); - if(!_promptedAfterResume) + if(_vm.FingerprintLock) { - _promptedAfterResume = true; - await _vm?.PromptFingerprintAsync(); + await Task.Delay(500); + if(!_promptedAfterResume) + { + _promptedAfterResume = true; + await _vm?.PromptFingerprintAsync(); + } } } diff --git a/src/App/Pages/Accounts/LockPageViewModel.cs b/src/App/Pages/Accounts/LockPageViewModel.cs index 01038f9e3..fabc21895 100644 --- a/src/App/Pages/Accounts/LockPageViewModel.cs +++ b/src/App/Pages/Accounts/LockPageViewModel.cs @@ -250,19 +250,23 @@ namespace Bit.App.Pages public async Task PromptFingerprintAsync() { + if(!FingerprintLock) + { + return; + } var success = await _platformUtilsService.AuthenticateFingerprintAsync(null, - PinLock ? AppResources.PIN : AppResources.MasterPassword, () => + PinLock ? AppResources.PIN : AppResources.MasterPassword, () => + { + var page = Page as LockPage; + if(PinLock) { - var page = Page as LockPage; - if(PinLock) - { - page.PinEntry.Focus(); - } - else - { - page.MasterPasswordEntry.Focus(); - } - }); + page.PinEntry.Focus(); + } + else + { + page.MasterPasswordEntry.Focus(); + } + }); _lockService.FingerprintLocked = !success; if(success) {