mirror of
https://github.com/bitwarden/mobile
synced 2026-01-06 10:34:07 +00:00
show/hide loading are async now
This commit is contained in:
@@ -179,9 +179,9 @@ namespace Bit.App.Pages
|
||||
return;
|
||||
}
|
||||
|
||||
_deviceActionService.ShowLoading(AppResources.LoggingIn);
|
||||
await _deviceActionService.ShowLoadingAsync(AppResources.LoggingIn);
|
||||
var result = await _authService.TokenPostAsync(EmailCell.Entry.Text, PasswordCell.Entry.Text);
|
||||
_deviceActionService.HideLoading();
|
||||
await _deviceActionService.HideLoadingAsync();
|
||||
|
||||
if(!result.Success)
|
||||
{
|
||||
|
||||
@@ -416,10 +416,10 @@ namespace Bit.App.Pages
|
||||
return;
|
||||
}
|
||||
|
||||
_deviceActionService.ShowLoading(string.Concat(AppResources.Validating, "..."));
|
||||
await _deviceActionService.ShowLoadingAsync(string.Concat(AppResources.Validating, "..."));
|
||||
var response = await _authService.TokenPostTwoFactorAsync(_providerType.Value, token, RememberCell.On,
|
||||
_email, _masterPasswordHash, _key);
|
||||
_deviceActionService.HideLoading();
|
||||
await _deviceActionService.HideLoadingAsync();
|
||||
|
||||
if(!response.Success)
|
||||
{
|
||||
|
||||
@@ -123,9 +123,9 @@ namespace Bit.App.Pages
|
||||
Email = EmailCell.Entry.Text
|
||||
};
|
||||
|
||||
_deviceActionService.ShowLoading(AppResources.Submitting);
|
||||
await _deviceActionService.ShowLoadingAsync(AppResources.Submitting);
|
||||
var response = await _accountApiRepository.PostPasswordHintAsync(request);
|
||||
_deviceActionService.HideLoading();
|
||||
await _deviceActionService.HideLoadingAsync();
|
||||
|
||||
if(!response.Succeeded)
|
||||
{
|
||||
|
||||
@@ -204,9 +204,9 @@ namespace Bit.App.Pages
|
||||
Key = encKey.EncryptedString
|
||||
};
|
||||
|
||||
_deviceActionService.ShowLoading(AppResources.CreatingAccount);
|
||||
await _deviceActionService.ShowLoadingAsync(AppResources.CreatingAccount);
|
||||
var response = await _accountsApiRepository.PostRegisterAsync(request);
|
||||
_deviceActionService.HideLoading();
|
||||
await _deviceActionService.HideLoadingAsync();
|
||||
|
||||
if(!response.Succeeded)
|
||||
{
|
||||
|
||||
@@ -85,9 +85,9 @@ namespace Bit.App.Pages
|
||||
Name = NameCell.Entry.Text.Encrypt()
|
||||
};
|
||||
|
||||
_deviceActionService.ShowLoading(AppResources.Saving);
|
||||
await _deviceActionService.ShowLoadingAsync(AppResources.Saving);
|
||||
var saveResult = await _folderService.SaveAsync(folder);
|
||||
_deviceActionService.HideLoading();
|
||||
await _deviceActionService.HideLoadingAsync();
|
||||
|
||||
if(saveResult.Succeeded)
|
||||
{
|
||||
|
||||
@@ -97,9 +97,9 @@ namespace Bit.App.Pages
|
||||
|
||||
folder.Name = NameCell.Entry.Text.Encrypt();
|
||||
|
||||
_deviceActionService.ShowLoading(AppResources.Saving);
|
||||
await _deviceActionService.ShowLoadingAsync(AppResources.Saving);
|
||||
var saveResult = await _folderService.SaveAsync(folder);
|
||||
_deviceActionService.HideLoading();
|
||||
await _deviceActionService.HideLoadingAsync();
|
||||
|
||||
if(saveResult.Succeeded)
|
||||
{
|
||||
@@ -161,9 +161,9 @@ namespace Bit.App.Pages
|
||||
return;
|
||||
}
|
||||
|
||||
_deviceActionService.ShowLoading(AppResources.Deleting);
|
||||
await _deviceActionService.ShowLoadingAsync(AppResources.Deleting);
|
||||
var deleteTask = await _folderService.DeleteAsync(_folderId);
|
||||
_deviceActionService.HideLoading();
|
||||
await _deviceActionService.HideLoadingAsync();
|
||||
|
||||
if(deleteTask.Succeeded)
|
||||
{
|
||||
|
||||
@@ -101,9 +101,9 @@ namespace Bit.App.Pages
|
||||
return;
|
||||
}
|
||||
|
||||
_deviceActionService.ShowLoading(AppResources.Syncing);
|
||||
await _deviceActionService.ShowLoadingAsync(AppResources.Syncing);
|
||||
var succeeded = await _syncService.FullSyncAsync(true);
|
||||
_deviceActionService.HideLoading();
|
||||
await _deviceActionService.HideLoadingAsync();
|
||||
if(succeeded)
|
||||
{
|
||||
_deviceActionService.Toast(AppResources.SyncingComplete);
|
||||
|
||||
@@ -775,9 +775,9 @@ namespace Bit.App.Pages
|
||||
|
||||
Helpers.ProcessFieldsSectionForSave(FieldsSection, cipher);
|
||||
|
||||
_deviceActionService.ShowLoading(AppResources.Saving);
|
||||
await _deviceActionService.ShowLoadingAsync(AppResources.Saving);
|
||||
var saveTask = await _cipherService.SaveAsync(cipher);
|
||||
_deviceActionService.HideLoading();
|
||||
await _deviceActionService.HideLoadingAsync();
|
||||
|
||||
if(saveTask.Succeeded)
|
||||
{
|
||||
|
||||
@@ -154,9 +154,9 @@ namespace Bit.App.Pages
|
||||
return;
|
||||
}
|
||||
|
||||
_deviceActionService.ShowLoading(AppResources.Saving);
|
||||
await _deviceActionService.ShowLoadingAsync(AppResources.Saving);
|
||||
var saveTask = await _cipherService.EncryptAndSaveAttachmentAsync(_cipher, _fileBytes, FileLabel.Text);
|
||||
_deviceActionService.HideLoading();
|
||||
await _deviceActionService.HideLoadingAsync();
|
||||
|
||||
if(saveTask.Succeeded)
|
||||
{
|
||||
@@ -280,9 +280,9 @@ namespace Bit.App.Pages
|
||||
return;
|
||||
}
|
||||
|
||||
_deviceActionService.ShowLoading(AppResources.Deleting);
|
||||
await _deviceActionService.ShowLoadingAsync(AppResources.Deleting);
|
||||
var saveTask = await _cipherService.DeleteAttachmentAsync(_cipher, attachment.Id);
|
||||
_deviceActionService.HideLoading();
|
||||
await _deviceActionService.HideLoadingAsync();
|
||||
|
||||
if(saveTask.Succeeded)
|
||||
{
|
||||
|
||||
@@ -639,9 +639,9 @@ namespace Bit.App.Pages
|
||||
|
||||
Helpers.ProcessFieldsSectionForSave(FieldsSection, Cipher);
|
||||
|
||||
_deviceActionService.ShowLoading(AppResources.Saving);
|
||||
await _deviceActionService.ShowLoadingAsync(AppResources.Saving);
|
||||
var saveTask = await _cipherService.SaveAsync(Cipher);
|
||||
_deviceActionService.HideLoading();
|
||||
await _deviceActionService.HideLoadingAsync();
|
||||
|
||||
if(saveTask.Succeeded)
|
||||
{
|
||||
@@ -892,9 +892,9 @@ namespace Bit.App.Pages
|
||||
return;
|
||||
}
|
||||
|
||||
_deviceActionService.ShowLoading(AppResources.Deleting);
|
||||
await _deviceActionService.ShowLoadingAsync(AppResources.Deleting);
|
||||
var deleteTask = await _cipherService.DeleteAsync(_cipherId);
|
||||
_deviceActionService.HideLoading();
|
||||
await _deviceActionService.HideLoadingAsync();
|
||||
|
||||
if(deleteTask.Succeeded)
|
||||
{
|
||||
|
||||
@@ -462,9 +462,9 @@ namespace Bit.App.Pages
|
||||
return;
|
||||
}
|
||||
|
||||
_deviceActionService.ShowLoading(AppResources.Downloading);
|
||||
await _deviceActionService.ShowLoadingAsync(AppResources.Downloading);
|
||||
var data = await _cipherService.DownloadAndDecryptAttachmentAsync(attachment.Url, cipher.OrganizationId);
|
||||
_deviceActionService.HideLoading();
|
||||
await _deviceActionService.HideLoadingAsync();
|
||||
|
||||
if(data == null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user