From 1d48171fd52db5eea40ca3831ec0b55df190fec0 Mon Sep 17 00:00:00 2001 From: Matt Portune <59324545+mportune-bw@users.noreply.github.com> Date: Tue, 28 Apr 2020 10:25:13 -0400 Subject: [PATCH] Prevent actionsheet command execution if vault is locked (#857) --- src/App/Utilities/AppHelpers.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/App/Utilities/AppHelpers.cs b/src/App/Utilities/AppHelpers.cs index 9ec27fcb8..f5dacd6c5 100644 --- a/src/App/Utilities/AppHelpers.cs +++ b/src/App/Utilities/AppHelpers.cs @@ -18,6 +18,7 @@ namespace Bit.App.Utilities { var platformUtilsService = ServiceContainer.Resolve("platformUtilsService"); var eventService = ServiceContainer.Resolve("eventService"); + var lockService = ServiceContainer.Resolve("lockService"); var options = new List { 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))); }