mirror of
https://github.com/bitwarden/android.git
synced 2024-12-24 01:48:25 +03:00
safety checks for popping modals
This commit is contained in:
parent
5b24d19630
commit
2fda7b8011
5 changed files with 12 additions and 7 deletions
|
@ -88,9 +88,9 @@ namespace Bit.App.Pages
|
|||
|
||||
if(saveResult.Succeeded)
|
||||
{
|
||||
await Navigation.PopForDeviceAsync();
|
||||
_userDialogs.Toast(AppResources.FolderCreated);
|
||||
_googleAnalyticsService.TrackAppEvent("CreatedFolder");
|
||||
await Navigation.PopForDeviceAsync();
|
||||
}
|
||||
else if(saveResult.Errors.Count() > 0)
|
||||
{
|
||||
|
|
|
@ -102,9 +102,9 @@ namespace Bit.App.Pages
|
|||
|
||||
if(saveResult.Succeeded)
|
||||
{
|
||||
await Navigation.PopForDeviceAsync();
|
||||
_userDialogs.Toast(AppResources.FolderUpdated);
|
||||
_googleAnalyticsService.TrackAppEvent("EditedFolder");
|
||||
await Navigation.PopForDeviceAsync();
|
||||
}
|
||||
else if(saveResult.Errors.Count() > 0)
|
||||
{
|
||||
|
@ -165,8 +165,8 @@ namespace Bit.App.Pages
|
|||
|
||||
if(deleteTask.Succeeded)
|
||||
{
|
||||
await Navigation.PopForDeviceAsync();
|
||||
_userDialogs.Toast(AppResources.FolderDeleted);
|
||||
await Navigation.PopForDeviceAsync();
|
||||
}
|
||||
else if(deleteTask.Errors.Count() > 0)
|
||||
{
|
||||
|
|
|
@ -173,11 +173,10 @@ namespace Bit.App.Pages
|
|||
|
||||
_userDialogs.ShowLoading(AppResources.Saving, MaskType.Black);
|
||||
var saveTask = await _loginService.SaveAsync(login);
|
||||
|
||||
_userDialogs.HideLoading();
|
||||
|
||||
if(saveTask.Succeeded)
|
||||
{
|
||||
await Navigation.PopForDeviceAsync();
|
||||
_userDialogs.Toast(AppResources.NewLoginCreated);
|
||||
if(_fromAutofill)
|
||||
{
|
||||
|
@ -187,6 +186,7 @@ namespace Bit.App.Pages
|
|||
{
|
||||
_googleAnalyticsService.TrackAppEvent("CreatedLogin");
|
||||
}
|
||||
await Navigation.PopForDeviceAsync();
|
||||
}
|
||||
else if(saveTask.Errors.Count() > 0)
|
||||
{
|
||||
|
|
|
@ -190,9 +190,9 @@ namespace Bit.App.Pages
|
|||
|
||||
if(saveTask.Succeeded)
|
||||
{
|
||||
await Navigation.PopForDeviceAsync();
|
||||
_userDialogs.Toast(AppResources.LoginUpdated);
|
||||
_googleAnalyticsService.TrackAppEvent("EditeLogin");
|
||||
await Navigation.PopForDeviceAsync();
|
||||
}
|
||||
else if(saveTask.Errors.Count() > 0)
|
||||
{
|
||||
|
@ -307,9 +307,9 @@ namespace Bit.App.Pages
|
|||
|
||||
if(deleteTask.Succeeded)
|
||||
{
|
||||
await Navigation.PopForDeviceAsync();
|
||||
_userDialogs.Toast(AppResources.LoginDeleted);
|
||||
_googleAnalyticsService.TrackAppEvent("DeletedLogin");
|
||||
await Navigation.PopForDeviceAsync();
|
||||
}
|
||||
else if(deleteTask.Errors.Count() > 0)
|
||||
{
|
||||
|
|
|
@ -60,6 +60,11 @@ namespace Bit.App
|
|||
|
||||
public static async Task PopForDeviceAsync(this INavigation navigation)
|
||||
{
|
||||
if(navigation.ModalStack.Count < 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
await navigation.PopModalAsync(true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue