1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-29 22:53:34 +00:00

refactor for cipher model changes and multi-uris

This commit is contained in:
Kyle Spearrin
2018-03-05 17:18:18 -05:00
parent 1f21a2ecc7
commit 83fd19784a
32 changed files with 491 additions and 223 deletions

View File

@@ -1,5 +1,7 @@
using Bit.App.Enums;
using Bit.App.Models.Data;
using Newtonsoft.Json;
using System;
namespace Bit.App.Models
{
@@ -9,7 +11,21 @@ namespace Bit.App.Models
public SecureNote(CipherData data)
{
Type = data.SecureNoteType.Value;
SecureNoteDataModel deserializedData;
if(data.SecureNote != null)
{
deserializedData = JsonConvert.DeserializeObject<SecureNoteDataModel>(data.SecureNote);
}
else if(data.Data != null)
{
deserializedData = JsonConvert.DeserializeObject<SecureNoteDataModel>(data.Data);
}
else
{
throw new ArgumentNullException(nameof(data.Identity));
}
Type = deserializedData.Type;
}
public SecureNoteType Type { get; set; }