mirror of
https://gitlab.com/fabinfra/fabaccess/borepin.git
synced 2025-03-12 14:51:44 +01:00
Fixed remove Bug
This commit is contained in:
parent
7693316701
commit
1893c7cddc
@ -73,6 +73,11 @@ namespace Borepin.PageModel.AddServerProcess
|
||||
}
|
||||
public async Task ConnectToServerExecute()
|
||||
{
|
||||
if (Host == "" || Host == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IsBusy = true;
|
||||
|
||||
try
|
||||
|
@ -108,7 +108,7 @@ namespace Borepin.PageModel
|
||||
{"intance", null },
|
||||
};
|
||||
|
||||
await _NavigationService.NavigateAsync("ScanPage", parameters).ConfigureAwait(false);
|
||||
await _NavigationService.NavigateAsync("ScanURNPage", parameters).ConfigureAwait(false);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ using Prism.Services;
|
||||
using Prism.Services.Dialogs;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Resources;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
using Xamarin.Forms;
|
||||
@ -22,6 +21,7 @@ namespace Borepin.PageModel
|
||||
#region Private Fields
|
||||
private readonly IDialogService _DialogService;
|
||||
private readonly ILoginStorageService _LoginStorageService;
|
||||
private bool IsDialog = false;
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
@ -71,7 +71,7 @@ namespace Borepin.PageModel
|
||||
InstanceIsDefaultConnection = true;
|
||||
}
|
||||
}
|
||||
if(instance == null && Connection_Item == null)
|
||||
if(instance == null && Connection_Item == null && IsDialog == false)
|
||||
{
|
||||
throw new InstanceIncorrectException();
|
||||
}
|
||||
@ -206,6 +206,7 @@ namespace Borepin.PageModel
|
||||
{ "instance", Connection_Item },
|
||||
};
|
||||
|
||||
IsDialog = true;
|
||||
_DialogService.ShowDialog("ConfirmDialog", parameters, DeleteCommandExecute_Dialog);
|
||||
}
|
||||
|
||||
@ -213,9 +214,9 @@ namespace Borepin.PageModel
|
||||
{
|
||||
if(string.Equals(result.Parameters.GetValue<string>("result"), "confirm", StringComparison.Ordinal))
|
||||
{
|
||||
await _API.Disconnect().ConfigureAwait(true);
|
||||
await _API.Disconnect().ConfigureAwait(false);
|
||||
_API.UnbindAllEvents();
|
||||
await _LoginStorageService.Remove(Connection_Item).ConfigureAwait(false);
|
||||
await _LoginStorageService.Remove(result.Parameters.GetValue<ConnectionData>("instance")).ConfigureAwait(false);
|
||||
|
||||
Device.BeginInvokeOnMainThread(async () =>
|
||||
{
|
||||
|
@ -64,7 +64,7 @@ namespace Borepin.Service.Storage
|
||||
await _SaveConnectionData(connectionData_List).ConfigureAwait(false);
|
||||
|
||||
ConnectionData connectionData_default = await GetDefault().ConfigureAwait(false);
|
||||
if (connectionData_default.Equals(connectionData))
|
||||
if (connectionData_default != null && connectionData_default.Equals(connectionData))
|
||||
{
|
||||
await RemoveDefault().ConfigureAwait(false);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user