mirror of
https://github.com/bitwarden/mobile
synced 2025-12-18 17:23:18 +00:00
Prevent actionsheet command execution if vault is locked (#857)
This commit is contained in:
@@ -18,6 +18,7 @@ namespace Bit.App.Utilities
|
|||||||
{
|
{
|
||||||
var platformUtilsService = ServiceContainer.Resolve<IPlatformUtilsService>("platformUtilsService");
|
var platformUtilsService = ServiceContainer.Resolve<IPlatformUtilsService>("platformUtilsService");
|
||||||
var eventService = ServiceContainer.Resolve<IEventService>("eventService");
|
var eventService = ServiceContainer.Resolve<IEventService>("eventService");
|
||||||
|
var lockService = ServiceContainer.Resolve<ILockService>("lockService");
|
||||||
var options = new List<string> { AppResources.View, AppResources.Edit };
|
var options = new List<string> { AppResources.View, AppResources.Edit };
|
||||||
if (cipher.Type == Core.Enums.CipherType.Login)
|
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());
|
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)));
|
await page.Navigation.PushModalAsync(new NavigationPage(new ViewPage(cipher.Id)));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user