mirror of
https://github.com/bitwarden/android.git
synced 2024-10-31 23:25:45 +03:00
Prevent actionsheet command execution if vault is locked (#857)
This commit is contained in:
parent
cb0a3e3edf
commit
1d48171fd5
1 changed files with 6 additions and 1 deletions
|
@ -18,6 +18,7 @@ namespace Bit.App.Utilities
|
|||
{
|
||||
var platformUtilsService = ServiceContainer.Resolve<IPlatformUtilsService>("platformUtilsService");
|
||||
var eventService = ServiceContainer.Resolve<IEventService>("eventService");
|
||||
var lockService = ServiceContainer.Resolve<ILockService>("lockService");
|
||||
var options = new List<string> { AppResources.View, AppResources.Edit };
|
||||
if (cipher.Type == Core.Enums.CipherType.Login)
|
||||
{
|
||||
|
@ -62,7 +63,11 @@ namespace Bit.App.Utilities
|
|||
}
|
||||
}
|
||||
var selection = await page.DisplayActionSheet(cipher.Name, AppResources.Cancel, null, options.ToArray());
|
||||
if (selection == AppResources.View)
|
||||
if (await lockService.IsLockedAsync())
|
||||
{
|
||||
platformUtilsService.ShowToast("info", null, AppResources.VaultIsLocked);
|
||||
}
|
||||
else if (selection == AppResources.View)
|
||||
{
|
||||
await page.Navigation.PushModalAsync(new NavigationPage(new ViewPage(cipher.Id)));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue