From 0106732cbda95679f585d9d3a69d20e1c0665b7d Mon Sep 17 00:00:00 2001 From: Robyn MacCallum Date: Thu, 10 Nov 2022 07:06:17 -0500 Subject: [PATCH] [SG-808] Only show 'remove account' option if user is in Accounts list (#2179) * Only show 'remove account' option if user is in Accounts list * Condense existing email logic * Add line break * Condense to local variable * Cleanup spacing --- src/App/Pages/Accounts/LoginPageViewModel.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/App/Pages/Accounts/LoginPageViewModel.cs b/src/App/Pages/Accounts/LoginPageViewModel.cs index 0dbcd07c1..f9cb0e308 100644 --- a/src/App/Pages/Accounts/LoginPageViewModel.cs +++ b/src/App/Pages/Accounts/LoginPageViewModel.cs @@ -1,4 +1,6 @@ using System; +using System.Collections.Generic; +using System.Linq; using System.Threading.Tasks; using System.Windows.Input; using Bit.App.Abstractions; @@ -247,7 +249,8 @@ namespace Bit.App.Pages private async Task MoreAsync() { - var buttons = IsEmailEnabled + var emailExists = _stateService.AccountViews != null && _stateService.AccountViews.Any(e => e.Email == Email); + var buttons = IsEmailEnabled || !emailExists ? new[] { AppResources.GetPasswordHint } : new[] { AppResources.GetPasswordHint, AppResources.RemoveAccount }; var selection = await _deviceActionService.DisplayActionSheetAsync(AppResources.Options, AppResources.Cancel, null, buttons);