1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-29 14:43:50 +00:00

Await async calls after loading. Added ConfigureAwaits throughout API repositories. Formatting.

This commit is contained in:
Kyle Spearrin
2016-08-16 19:20:41 -04:00
parent 83bcd39791
commit 2c05c9595b
16 changed files with 126 additions and 109 deletions

View File

@@ -35,13 +35,13 @@ namespace Bit.App.Repositories
try
{
var response = await client.SendAsync(requestMessage);
var response = await client.SendAsync(requestMessage).ConfigureAwait(false);
if(!response.IsSuccessStatusCode)
{
return await HandleErrorAsync<CipherResponse>(response);
return await HandleErrorAsync<CipherResponse>(response).ConfigureAwait(false);
}
var responseContent = await response.Content.ReadAsStringAsync();
var responseContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
var responseObj = JsonConvert.DeserializeObject<CipherResponse>(responseContent);
return ApiResult<CipherResponse>.Success(responseObj, response.StatusCode);
}
@@ -69,13 +69,13 @@ namespace Bit.App.Repositories
try
{
var response = await client.SendAsync(requestMessage);
var response = await client.SendAsync(requestMessage).ConfigureAwait(false);
if(!response.IsSuccessStatusCode)
{
return await HandleErrorAsync<ListResponse<CipherResponse>>(response);
return await HandleErrorAsync<ListResponse<CipherResponse>>(response).ConfigureAwait(false);
}
var responseContent = await response.Content.ReadAsStringAsync();
var responseContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
var responseObj = JsonConvert.DeserializeObject<ListResponse<CipherResponse>>(responseContent);
return ApiResult<ListResponse<CipherResponse>>.Success(responseObj, response.StatusCode);
}
@@ -103,13 +103,13 @@ namespace Bit.App.Repositories
try
{
var response = await client.SendAsync(requestMessage);
var response = await client.SendAsync(requestMessage).ConfigureAwait(false);
if(!response.IsSuccessStatusCode)
{
return await HandleErrorAsync<CipherHistoryResponse>(response);
return await HandleErrorAsync<CipherHistoryResponse>(response).ConfigureAwait(false);
}
var responseContent = await response.Content.ReadAsStringAsync();
var responseContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
var responseObj = JsonConvert.DeserializeObject<CipherHistoryResponse>(responseContent);
return ApiResult<CipherHistoryResponse>.Success(responseObj, response.StatusCode);
}