Skip to content

Commit

Permalink
Updated Add new item button text when creating a new passkey
Browse files Browse the repository at this point in the history
  • Loading branch information
dinisvieira committed Apr 3, 2024
1 parent 9ae67b3 commit 0292071
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/App/Platforms/Android/Services/DeviceActionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -576,12 +576,10 @@ public async Task ExecuteFido2CredentialActionAsync(AppOptions appOptions)

if (appOptions.Fido2CredentialAction == CredentialProviderConstants.Fido2CredentialGet)
{
//TODO: Old POC code used for auth of a passkey after unlock. Maybe it can be reused
await ExecuteFido2GetCredentialAsync(appOptions);
}
else if (appOptions.Fido2CredentialAction == CredentialProviderConstants.Fido2CredentialCreate)
{
//TODO: Old POC code used for creating a passkey after unlock. Maybe it can be reused
await ExecuteFido2CreateCredentialAsync();
}

Expand Down
1 change: 1 addition & 0 deletions src/Core/Pages/Vault/AutofillCiphersPageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public override void Init(AppOptions appOptions)
Name = name;
PageTitle = string.Format(AppResources.ItemsForUri, Name ?? "--");
NoDataText = string.Format(AppResources.NoItemsForUri, Name ?? "--");
AddNewItemText = appOptions.FromFido2Framework ? AppResources.SavePasskeyAsNewLogin : AppResources.AddAnItem;
}

protected override async Task<List<GroupingsPageListGroup>> LoadGroupedItemsAsync()
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Pages/Vault/CipherSelectionPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
Text="{Binding NoDataText}"
HorizontalTextAlignment="Center"></Label>
<Button
Text="{u:I18n AddAnItem}"
Text="{Binding AddNewItemText}"
Command="{Binding AddCipherCommand}" />
</StackLayout>

Expand Down
10 changes: 10 additions & 0 deletions src/Core/Pages/Vault/CipherSelectionPageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Bit.App.Utilities;
using Bit.Core.Abstractions;
using Bit.Core.Models.View;
using Bit.Core.Resources.Localization;
using Bit.Core.Utilities;

namespace Bit.App.Pages
Expand All @@ -22,6 +23,7 @@ public abstract class CipherSelectionPageViewModel : BaseViewModel
protected bool _showNoData;
protected bool _showList;
protected string _noDataText;
protected string _addNewItemText;
protected bool _websiteIconsEnabled;

public CipherSelectionPageViewModel()
Expand Down Expand Up @@ -53,6 +55,8 @@ public CipherSelectionPageViewModel()
{
AllowAddAccountRow = false
};

AddNewItemText = AppResources.AddAnItem;
}

public string Name { get; set; }
Expand Down Expand Up @@ -83,6 +87,12 @@ public string NoDataText
set => SetProperty(ref _noDataText, value);
}

public string AddNewItemText
{
get => _addNewItemText;
set => SetProperty(ref _addNewItemText, value);
}

public bool WebsiteIconsEnabled
{
get => _websiteIconsEnabled;
Expand Down

0 comments on commit 0292071

Please sign in to comment.