mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
Fix GUI host prompt.
This commit is contained in:
parent
511ba665cb
commit
91053e21a2
@ -59,10 +59,14 @@ namespace Remotely.Desktop.Core.Services
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Connection != null)
|
||||
if (Connection?.State == HubConnectionState.Connected)
|
||||
{
|
||||
await Connection.StopAsync();
|
||||
await Connection.DisposeAsync();
|
||||
try
|
||||
{
|
||||
await Connection.StopAsync();
|
||||
await Connection.DisposeAsync();
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
Connection = new HubConnectionBuilder()
|
||||
.WithUrl($"{host}/CasterHub")
|
||||
|
||||
@ -206,7 +206,7 @@ namespace Remotely.Desktop.Linux.ViewModels
|
||||
}
|
||||
prompt.Owner = MainWindow.Current;
|
||||
await prompt.ShowDialog(MainWindow.Current);
|
||||
var result = prompt.ViewModel.Host;
|
||||
var result = prompt.ViewModel.Host?.TrimEnd('/');
|
||||
|
||||
if (result is null)
|
||||
{
|
||||
@ -219,7 +219,7 @@ namespace Remotely.Desktop.Linux.ViewModels
|
||||
}
|
||||
if (result != Host)
|
||||
{
|
||||
Host = result.TrimEnd('/');
|
||||
Host = result;
|
||||
var config = ConfigService.GetConfig();
|
||||
config.Host = Host;
|
||||
ConfigService.Save(config);
|
||||
|
||||
@ -251,14 +251,14 @@ namespace Remotely.Desktop.Win.ViewModels
|
||||
}
|
||||
prompt.Owner = App.Current?.MainWindow;
|
||||
prompt.ShowDialog();
|
||||
var result = prompt.ViewModel.Host;
|
||||
var result = prompt.ViewModel.Host?.TrimEnd('/');
|
||||
if (!result.StartsWith("https://") && !result.StartsWith("http://"))
|
||||
{
|
||||
result = $"https://{result}";
|
||||
}
|
||||
if (result != Host)
|
||||
{
|
||||
Host = result.TrimEnd('/');
|
||||
Host = result;
|
||||
var config = ConfigService.GetConfig();
|
||||
config.Host = Host;
|
||||
ConfigService.Save(config);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user