mirror of
https://github.com/bitwarden/android.git
synced 2024-12-24 01:48:25 +03:00
trim Uri proper from stored json on save
This commit is contained in:
parent
005b2a4fb6
commit
deb1ead4ea
3 changed files with 8 additions and 5 deletions
|
@ -5,6 +5,7 @@ using Newtonsoft.Json;
|
|||
using System.Linq;
|
||||
using Bit.App.Enums;
|
||||
using Bit.App.Models.Api;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace Bit.App.Models.Data
|
||||
{
|
||||
|
@ -31,8 +32,10 @@ namespace Bit.App.Models.Data
|
|||
switch(cipher.Type)
|
||||
{
|
||||
case CipherType.Login:
|
||||
var loginData = new LoginDataModel(cipher);
|
||||
Login = JsonConvert.SerializeObject(loginData);
|
||||
var loginObj = JObject.FromObject(new LoginDataModel(cipher),
|
||||
new JsonSerializer { NullValueHandling = NullValueHandling.Ignore });
|
||||
loginObj[nameof(LoginDataModel.Uri)]?.Parent?.Remove();
|
||||
Login = loginObj.ToString(Formatting.None);
|
||||
break;
|
||||
case CipherType.SecureNote:
|
||||
var noteData = new SecureNoteDataModel(cipher);
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace Bit.App.Models.Data
|
|||
{
|
||||
Name = cipher.Name;
|
||||
Notes = cipher.Notes;
|
||||
Fields = cipher.Fields.Select(f => new FieldDataModel(f));
|
||||
Fields = cipher.Fields?.Select(f => new FieldDataModel(f));
|
||||
}
|
||||
|
||||
public string Name { get; set; }
|
||||
|
|
|
@ -11,9 +11,9 @@ namespace Bit.App.Models
|
|||
public Identity(CipherData data)
|
||||
{
|
||||
IdentityDataModel deserializedData;
|
||||
if(data.Card != null)
|
||||
if(data.Identity != null)
|
||||
{
|
||||
deserializedData = JsonConvert.DeserializeObject<IdentityDataModel>(data.Card);
|
||||
deserializedData = JsonConvert.DeserializeObject<IdentityDataModel>(data.Identity);
|
||||
}
|
||||
else if(data.Data != null)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue