prompt fignerprint on resume of lock page

This commit is contained in:
Kyle Spearrin 2019-06-06 08:04:54 -04:00
parent d6fd3edb3c
commit 6f905319c3
2 changed files with 22 additions and 0 deletions

View file

@ -184,6 +184,10 @@ namespace Bit.App
{
SyncIfNeeded();
}
if(Current.MainPage is NavigationPage navPage && navPage.CurrentPage is LockPage lockPage)
{
await lockPage.PromptFingerprintAfterResumeAsync();
}
}
private void SetCulture()

View file

@ -11,6 +11,9 @@ namespace Bit.App.Pages
private readonly bool _autoPromptFingerprint;
private readonly LockPageViewModel _vm;
private bool _promptedAfterResume;
private bool _appeared;
public LockPage(AppOptions appOptions = null, bool autoPromptFingerprint = true)
{
_appOptions = appOptions;
@ -42,9 +45,24 @@ namespace Bit.App.Pages
public Entry MasterPasswordEntry { get; set; }
public Entry PinEntry { get; set; }
public async Task PromptFingerprintAfterResumeAsync()
{
await Task.Delay(500);
if(!_promptedAfterResume)
{
_promptedAfterResume = true;
await _vm?.PromptFingerprintAsync();
}
}
protected override async void OnAppearing()
{
base.OnAppearing();
if(_appeared)
{
return;
}
_appeared = true;
await _vm.InitAsync(_autoPromptFingerprint);
if(!_vm.FingerprintLock)
{