mirror of
https://github.com/bitwarden/android.git
synced 2024-10-31 15:15:34 +03:00
prompt fignerprint on resume of lock page
This commit is contained in:
parent
d6fd3edb3c
commit
6f905319c3
2 changed files with 22 additions and 0 deletions
|
@ -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()
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue