mirror of
https://github.com/bitwarden/mobile.git
synced 2024-11-26 12:16:07 +01:00
return selection collection logic
This commit is contained in:
parent
2d91a893f7
commit
a158021f46
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user