mirror of
https://github.com/bitwarden/mobile.git
synced 2024-12-28 17:18:23 +01:00
dont process OnSaveRequest if prompt disabled
This commit is contained in:
parent
59620e6435
commit
999c9667c8
@ -22,6 +22,7 @@ namespace Bit.Droid.Autofill
|
||||
{
|
||||
private ICipherService _cipherService;
|
||||
private ILockService _lockService;
|
||||
private IStorageService _storageService;
|
||||
|
||||
public async override void OnFillRequest(FillRequest request, CancellationSignal cancellationSignal, FillCallback callback)
|
||||
{
|
||||
@ -38,10 +39,10 @@ namespace Bit.Droid.Autofill
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(_lockService == null)
|
||||
{
|
||||
_lockService = ServiceContainer.Resolve<ILockService>("lockService");
|
||||
_lockService = ServiceContainer.Resolve<ILockService>("lockService");
|
||||
}
|
||||
|
||||
List<FilledItem> items = null;
|
||||
@ -60,7 +61,7 @@ namespace Bit.Droid.Autofill
|
||||
callback.OnSuccess(response);
|
||||
}
|
||||
|
||||
public override void OnSaveRequest(SaveRequest request, SaveCallback callback)
|
||||
public async override void OnSaveRequest(SaveRequest request, SaveCallback callback)
|
||||
{
|
||||
var structure = request.FillContexts?.LastOrDefault()?.Structure;
|
||||
if(structure == null)
|
||||
@ -68,6 +69,17 @@ namespace Bit.Droid.Autofill
|
||||
return;
|
||||
}
|
||||
|
||||
if(_storageService == null)
|
||||
{
|
||||
_storageService = ServiceContainer.Resolve<IStorageService>("storageService");
|
||||
}
|
||||
|
||||
var disableSavePrompt = await _storageService.GetAsync<bool?>(Constants.AutofillDisableSavePromptKey);
|
||||
if(disableSavePrompt.GetValueOrDefault())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var parser = new Parser(structure, ApplicationContext);
|
||||
parser.Parse();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user