sort sites and folders

This commit is contained in:
Kyle Spearrin 2016-08-02 18:45:25 -04:00
parent a732e8953b
commit ae37c634ef
3 changed files with 4 additions and 3 deletions

View file

@ -51,7 +51,7 @@ namespace Bit.App.Pages
private async Task LoadFoldersAsync()
{
var folders = await _folderService.GetAllAsync();
var pageFolders = folders.Select(f => new SettingsFolderPageModel(f));
var pageFolders = folders.Select(f => new SettingsFolderPageModel(f)).OrderBy(f => f.Name);
Folders.ResetWithRange(pageFolders);
}

View file

@ -201,8 +201,8 @@ namespace Bit.App.Pages
var folders = await foldersTask;
var sites = await sitesTask;
Folders = folders.Select(f => new VaultListPageModel.Folder(f));
Sites = sites.Select(s => new VaultListPageModel.Site(s));
Folders = folders.Select(f => new VaultListPageModel.Folder(f)).OrderBy(s => s.Name);
Sites = sites.Select(s => new VaultListPageModel.Site(s)).OrderBy(s => s.Name).ThenBy(s => s.Username);
FilterResults(Search.Text);
});

View file

@ -100,6 +100,7 @@ namespace Bit.iOS.Extension
var siteModels = sites.Select(s => new SiteViewModel(s));
_tableItems = siteModels
.Where(s => s.Domain != null && s.Domain.BaseDomain == _context.DomainName.BaseDomain)
.OrderBy(s => s.Name).ThenBy(s => s.Username)
.ToList();
}
}