mirror of
https://github.com/bitwarden/mobile
synced 2025-12-16 08:13:20 +00:00
Centralized logout into a message subscription in app class. Logout when API results are forbidden or unauthorized.
This commit is contained in:
@@ -7,6 +7,7 @@ using Bit.App.Resources;
|
||||
using Plugin.Connectivity.Abstractions;
|
||||
using Xamarin.Forms;
|
||||
using XLabs.Ioc;
|
||||
using System.Linq;
|
||||
|
||||
namespace Bit.App.Pages
|
||||
{
|
||||
@@ -74,8 +75,16 @@ namespace Bit.App.Pages
|
||||
await saveTask;
|
||||
|
||||
_userDialogs.HideLoading();
|
||||
await Navigation.PopModalAsync();
|
||||
_userDialogs.SuccessToast(nameCell.Entry.Text, "New folder created.");
|
||||
|
||||
if(saveTask.Result.Succeeded)
|
||||
{
|
||||
await Navigation.PopModalAsync();
|
||||
_userDialogs.SuccessToast(nameCell.Entry.Text, "New folder created.");
|
||||
}
|
||||
else if(saveTask.Result.Errors.Count() > 0)
|
||||
{
|
||||
await _userDialogs.AlertAsync(saveTask.Result.Errors.First().Message, AppResources.AnErrorHasOccurred);
|
||||
}
|
||||
}, ToolbarItemOrder.Default, 0);
|
||||
|
||||
Title = "Add Folder";
|
||||
|
||||
Reference in New Issue
Block a user