mirror of
https://github.com/bitwarden/mobile
synced 2025-12-05 23:53:33 +00:00
[PM-7407] Implemented check for organizations with unassigned items (#3150)
This commit is contained in:
committed by
GitHub
parent
43a4915323
commit
e7a7eed7e8
@@ -829,6 +829,24 @@ namespace Bit.Core.Services
|
||||
await ClearCacheAsync();
|
||||
}
|
||||
|
||||
public async Task<bool> VerifyOrganizationHasUnassignedItemsAsync()
|
||||
{
|
||||
var organizations = await _stateService.GetOrganizationsAsync();
|
||||
if (organizations?.Any() != true)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return await _apiService.HasUnassignedCiphersAsync();
|
||||
}
|
||||
catch (ApiException ex) when (ex.Error?.StatusCode == System.Net.HttpStatusCode.BadRequest)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Helpers
|
||||
|
||||
private async Task<Tuple<SymmetricCryptoKey, EncString, SymmetricCryptoKey>> MakeAttachmentKeyAsync(string organizationId, Cipher cipher = null, CipherView cipherView = null)
|
||||
|
||||
Reference in New Issue
Block a user