From b90e030b8f56011483ee4aa897d5136eefef45bc Mon Sep 17 00:00:00 2001 From: mpbw2 <59324545+mpbw2@users.noreply.github.com> Date: Mon, 11 Dec 2023 16:40:09 -0500 Subject: [PATCH] [PM-4837] Hide TOTP seed copy button when Can view, except password permission set (#2869) * Hide TOTP seed copy button when Can view, except password permission set * additional check * removal of null check --- src/App/Pages/Vault/CipherAddEditPage.xaml | 2 +- src/App/Pages/Vault/CipherAddEditPageViewModel.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/App/Pages/Vault/CipherAddEditPage.xaml b/src/App/Pages/Vault/CipherAddEditPage.xaml index 7785457b0..0ad114b1f 100644 --- a/src/App/Pages/Vault/CipherAddEditPage.xaml +++ b/src/App/Pages/Vault/CipherAddEditPage.xaml @@ -292,7 +292,7 @@ StyleClass="box-row-button, box-row-button-platform" Text="{Binding Source={x:Static core:BitwardenIcons.Clone}}" Command="{Binding CopyCommand}" - IsVisible="{Binding HasTotpValue}" + IsVisible="{Binding AllowTotpCopy}" Grid.Row="0" Grid.Column="1" Grid.RowSpan="2" diff --git a/src/App/Pages/Vault/CipherAddEditPageViewModel.cs b/src/App/Pages/Vault/CipherAddEditPageViewModel.cs index a80cb8fb7..03c676672 100644 --- a/src/App/Pages/Vault/CipherAddEditPageViewModel.cs +++ b/src/App/Pages/Vault/CipherAddEditPageViewModel.cs @@ -307,6 +307,7 @@ namespace Bit.App.Pages public bool PasswordPrompt => Cipher.Reprompt != CipherRepromptType.None; public string PasswordVisibilityAccessibilityText => ShowPassword ? AppResources.PasswordIsVisibleTapToHide : AppResources.PasswordIsNotVisibleTapToShow; public bool HasTotpValue => IsLogin && !string.IsNullOrEmpty(Cipher?.Login?.Totp); + public bool AllowTotpCopy => HasTotpValue && Cipher.ViewPassword; public string SetupTotpText => $"{BitwardenIcons.Camera} {AppResources.SetupTotp}"; public bool ShowPasskeyInfo => Cipher?.HasFido2Credential == true && !CloneMode;