diff --git a/src/App/Pages/Settings/SettingsAddFolderPage.cs b/src/App/Pages/Settings/SettingsAddFolderPage.cs index 665a4e77f..8e6743c40 100644 --- a/src/App/Pages/Settings/SettingsAddFolderPage.cs +++ b/src/App/Pages/Settings/SettingsAddFolderPage.cs @@ -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) { diff --git a/src/App/Pages/Settings/SettingsEditFolderPage.cs b/src/App/Pages/Settings/SettingsEditFolderPage.cs index 6e9659dc1..b5b01adc3 100644 --- a/src/App/Pages/Settings/SettingsEditFolderPage.cs +++ b/src/App/Pages/Settings/SettingsEditFolderPage.cs @@ -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) { diff --git a/src/App/Pages/Vault/VaultAddLoginPage.cs b/src/App/Pages/Vault/VaultAddLoginPage.cs index 77b5d39c9..6eff23482 100644 --- a/src/App/Pages/Vault/VaultAddLoginPage.cs +++ b/src/App/Pages/Vault/VaultAddLoginPage.cs @@ -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) { diff --git a/src/App/Pages/Vault/VaultEditLoginPage.cs b/src/App/Pages/Vault/VaultEditLoginPage.cs index eeb46b80e..08e6463c9 100644 --- a/src/App/Pages/Vault/VaultEditLoginPage.cs +++ b/src/App/Pages/Vault/VaultEditLoginPage.cs @@ -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) { diff --git a/src/App/Utilities/Extentions.cs b/src/App/Utilities/Extentions.cs index 295bbb424..1f84e3692 100644 --- a/src/App/Utilities/Extentions.cs +++ b/src/App/Utilities/Extentions.cs @@ -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); }