Merge branch 'fix/changeconnetionhangup' into 'main'

Fixed: Hangup on change connection while connected

See merge request fabinfra/fabaccess/borepin!80
This commit is contained in:
TheJoKlLa 2023-02-28 12:27:20 +00:00
commit 2c71fc3949
2 changed files with 8 additions and 11 deletions

View File

@ -111,17 +111,13 @@ namespace Borepin.PageModel.AddServerProcess
},
};
if (_API.IsConnected)
try
{
if (_API.IsConnected)
if (_API.IsConnecting || _API.IsConnected)
{
await _API.Disconnect().ConfigureAwait(true);
_API.UnbindEventHandler();
}
}
try
{
await _API.Connect(_ConnectionData).ConfigureAwait(false);
}
catch (Exception exception)

View File

@ -133,13 +133,14 @@ namespace Borepin.PageModel
IsBusy = true;
TestConnection = true;
if (_API.IsConnected)
{
await _API.Disconnect().ConfigureAwait(true);
}
try
{
if (_API.IsConnecting || _API.IsConnected)
{
await _API.Disconnect().ConfigureAwait(true);
_API.UnbindEventHandler();
}
await _API.Connect(Connection_Item).ConfigureAwait(false);
}
catch(Exception exception)