1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-04 09:33:16 +00:00

lazy decrypt password and username for vault listing. dynamically show copy and url launch options if provided.

This commit is contained in:
Kyle Spearrin
2016-07-06 22:59:13 -04:00
parent 29c7a0ccf0
commit 31ad96ff31
4 changed files with 25 additions and 8 deletions

View File

@@ -16,16 +16,16 @@ namespace Bit.App.Models.Page
FolderId = folderId;
Name = site.Name?.Decrypt();
Username = site.Username?.Decrypt() ?? " ";
Password = site.Password?.Decrypt();
Uri = site.Uri?.Decrypt();
Password = new Lazy<string>(() => site.Password?.Decrypt());
Uri = new Lazy<string>(() => site.Uri?.Decrypt());
}
public string Id { get; set; }
public string FolderId { get; set; }
public string Name { get; set; }
public string Username { get; set; }
public string Password { get; set; }
public string Uri { get; set; }
public Lazy<string> Password { get; set; }
public Lazy<string> Uri { get; set; }
}
public class Folder : List<Site>

View File

@@ -61,9 +61,11 @@ namespace Bit.App.Models.Page
PropertyChanged(this, new PropertyChangedEventArgs(nameof(Uri)));
PropertyChanged(this, new PropertyChangedEventArgs(nameof(UriHost)));
PropertyChanged(this, new PropertyChangedEventArgs(nameof(ShowUri)));
PropertyChanged(this, new PropertyChangedEventArgs(nameof(ShowLaunch)));
}
}
public bool ShowUri => !string.IsNullOrWhiteSpace(Uri);
public bool ShowLaunch => Uri.StartsWith("http://") || Uri.StartsWith("https://");
public string UriHost
{