From 8970525861a21260808d8ade62a77ce94744ea9f Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 20 Oct 2017 16:56:10 -0400 Subject: [PATCH] Fix cipher changes in extension model --- src/iOS.Extension/Models/LoginViewModel.cs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/iOS.Extension/Models/LoginViewModel.cs b/src/iOS.Extension/Models/LoginViewModel.cs index 72a40254a..0ab937e12 100644 --- a/src/iOS.Extension/Models/LoginViewModel.cs +++ b/src/iOS.Extension/Models/LoginViewModel.cs @@ -7,27 +7,27 @@ namespace Bit.iOS.Extension.Models { public class LoginViewModel { - public LoginViewModel(Cipher login) + public LoginViewModel(Cipher cipher) { - Id = login.Id; - Name = login.Name?.Decrypt(login.OrganizationId); - Username = login.Username?.Decrypt(login.OrganizationId); - Password = login.Password?.Decrypt(login.OrganizationId); - Uri = login.Uri?.Decrypt(login.OrganizationId); - Totp = new Lazy(() => login.Totp?.Decrypt(login.OrganizationId)); + Id = cipher.Id; + Name = cipher.Name?.Decrypt(cipher.OrganizationId); + Username = cipher.Login?.Username?.Decrypt(cipher.OrganizationId); + Password = cipher.Login?.Password?.Decrypt(cipher.OrganizationId); + Uri = cipher.Login?.Uri?.Decrypt(cipher.OrganizationId); + Totp = new Lazy(() => cipher.Login?.Totp?.Decrypt(cipher.OrganizationId)); Fields = new Lazy>>(() => { - if(!login.Fields?.Any() ?? true) + if(!cipher.Fields?.Any() ?? true) { return null; } var fields = new List>(); - foreach(var field in login.Fields) + foreach(var field in cipher.Fields) { fields.Add(new Tuple( - field.Name?.Decrypt(login.OrganizationId), - field.Value?.Decrypt(login.OrganizationId))); + field.Name?.Decrypt(cipher.OrganizationId), + field.Value?.Decrypt(cipher.OrganizationId))); } return fields; });