1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-11-07 09:20:04 +01:00

return selection collection logic

This commit is contained in:
Kyle Spearrin 2019-06-26 17:50:57 -04:00
parent 2d91a893f7
commit a158021f46
2 changed files with 6 additions and 6 deletions

View File

@ -58,7 +58,8 @@ namespace Bit.App.Pages
public async Task<bool> SubmitAsync()
{
if(!Collections.Any(c => c.Checked))
var selectedCollectionIds = Collections?.Where(c => c.Checked).Select(c => c.Collection.Id);
if(!selectedCollectionIds?.Any() ?? true)
{
await Page.DisplayAlert(AppResources.AnErrorHasOccurred, AppResources.SelectOneCollection,
AppResources.Ok);
@ -71,8 +72,7 @@ namespace Bit.App.Pages
return false;
}
_cipherDomain.CollectionIds = new HashSet<string>(
Collections.Where(c => c.Checked).Select(c => c.Collection.Id));
_cipherDomain.CollectionIds = new HashSet<string>(selectedCollectionIds);
try
{
await _deviceActionService.ShowLoadingAsync(AppResources.Saving);

View File

@ -86,7 +86,8 @@ namespace Bit.App.Pages
public async Task<bool> SubmitAsync()
{
if(!Collections?.Any(c => c.Checked) ?? true)
var selectedCollectionIds = Collections?.Where(c => c.Checked).Select(c => c.Collection.Id);
if(!selectedCollectionIds?.Any() ?? true)
{
await Page.DisplayAlert(AppResources.AnErrorHasOccurred, AppResources.SelectOneCollection,
AppResources.Ok);
@ -102,8 +103,7 @@ namespace Bit.App.Pages
var cipherDomain = await _cipherService.GetAsync(CipherId);
var cipherView = await cipherDomain.DecryptAsync();
var checkedCollectionIds = new HashSet<string>(
Collections.Where(c => c.Checked).Select(c => c.Collection.Id));
var checkedCollectionIds = new HashSet<string>(selectedCollectionIds);
try
{
await _deviceActionService.ShowLoadingAsync(AppResources.Saving);