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:
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user