mirror of
https://github.com/bitwarden/android.git
synced 2025-01-11 18:57:39 +03:00
Fix cipher changes in extension model
This commit is contained in:
parent
5a88a66709
commit
8970525861
1 changed files with 11 additions and 11 deletions
|
@ -7,27 +7,27 @@ namespace Bit.iOS.Extension.Models
|
||||||
{
|
{
|
||||||
public class LoginViewModel
|
public class LoginViewModel
|
||||||
{
|
{
|
||||||
public LoginViewModel(Cipher login)
|
public LoginViewModel(Cipher cipher)
|
||||||
{
|
{
|
||||||
Id = login.Id;
|
Id = cipher.Id;
|
||||||
Name = login.Name?.Decrypt(login.OrganizationId);
|
Name = cipher.Name?.Decrypt(cipher.OrganizationId);
|
||||||
Username = login.Username?.Decrypt(login.OrganizationId);
|
Username = cipher.Login?.Username?.Decrypt(cipher.OrganizationId);
|
||||||
Password = login.Password?.Decrypt(login.OrganizationId);
|
Password = cipher.Login?.Password?.Decrypt(cipher.OrganizationId);
|
||||||
Uri = login.Uri?.Decrypt(login.OrganizationId);
|
Uri = cipher.Login?.Uri?.Decrypt(cipher.OrganizationId);
|
||||||
Totp = new Lazy<string>(() => login.Totp?.Decrypt(login.OrganizationId));
|
Totp = new Lazy<string>(() => cipher.Login?.Totp?.Decrypt(cipher.OrganizationId));
|
||||||
Fields = new Lazy<List<Tuple<string, string>>>(() =>
|
Fields = new Lazy<List<Tuple<string, string>>>(() =>
|
||||||
{
|
{
|
||||||
if(!login.Fields?.Any() ?? true)
|
if(!cipher.Fields?.Any() ?? true)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
var fields = new List<Tuple<string, string>>();
|
var fields = new List<Tuple<string, string>>();
|
||||||
foreach(var field in login.Fields)
|
foreach(var field in cipher.Fields)
|
||||||
{
|
{
|
||||||
fields.Add(new Tuple<string, string>(
|
fields.Add(new Tuple<string, string>(
|
||||||
field.Name?.Decrypt(login.OrganizationId),
|
field.Name?.Decrypt(cipher.OrganizationId),
|
||||||
field.Value?.Decrypt(login.OrganizationId)));
|
field.Value?.Decrypt(cipher.OrganizationId)));
|
||||||
}
|
}
|
||||||
return fields;
|
return fields;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue