1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-24 04:04:34 +00:00

Don't build the keyboard index for autofill if using logout action (#943)

* Don't build the keyboard index for autofill if using logout action

* trigger index rebuild on vault timeout changed event
This commit is contained in:
Kyle Spearrin
2020-06-01 14:46:53 -04:00
committed by GitHub
parent 24547e67bf
commit 1120bff34d
3 changed files with 44 additions and 8 deletions

View File

@@ -15,6 +15,11 @@ namespace Bit.iOS.Core.Utilities
if (await AutofillEnabled())
{
var storageService = ServiceContainer.Resolve<IStorageService>("storageService");
var timeoutAction = await storageService.GetAsync<string>(Bit.Core.Constants.VaultTimeoutActionKey);
if (timeoutAction == "logOut")
{
return;
}
var vaultTimeoutService = ServiceContainer.Resolve<IVaultTimeoutService>("vaultTimeoutService");
if (await vaultTimeoutService.IsLockedAsync())
{
@@ -42,6 +47,12 @@ namespace Bit.iOS.Core.Utilities
public static async Task<bool> IdentitiesCanIncremental()
{
var storageService = ServiceContainer.Resolve<IStorageService>("storageService");
var timeoutAction = await storageService.GetAsync<string>(Bit.Core.Constants.VaultTimeoutActionKey);
if (timeoutAction == "logOut")
{
return false;
}
var state = await ASCredentialIdentityStore.SharedStore?.GetCredentialIdentityStoreStateAsync();
return state != null && state.Enabled && state.SupportsIncrementalUpdates;
}