mirror of
https://github.com/bitwarden/mobile
synced 2025-12-10 21:33:36 +00:00
convert to local functions to avoid continuewith
This commit is contained in:
@@ -67,10 +67,15 @@ namespace Bit.Core.Services
|
||||
return new List<CollectionView>();
|
||||
}
|
||||
var decCollections = new List<CollectionView>();
|
||||
async Task decryptAndAddCollectionAsync(Collection collection)
|
||||
{
|
||||
var c = await collection.DecryptAsync();
|
||||
decCollections.Add(c);
|
||||
}
|
||||
var tasks = new List<Task>();
|
||||
foreach(var collection in collections)
|
||||
{
|
||||
tasks.Add(collection.DecryptAsync().ContinueWith(async c => decCollections.Add(await c)));
|
||||
tasks.Add(decryptAndAddCollectionAsync(collection));
|
||||
}
|
||||
await Task.WhenAll(tasks);
|
||||
return decCollections.OrderBy(c => c, new CollectionLocaleComparer(_i18nService)).ToList();
|
||||
|
||||
Reference in New Issue
Block a user