1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-18 17:23:18 +00:00

trim Uri proper from stored json on save

This commit is contained in:
Kyle Spearrin
2018-03-05 23:49:48 -05:00
parent 005b2a4fb6
commit deb1ead4ea
3 changed files with 8 additions and 5 deletions

View File

@@ -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);