Making sure that server is terminated even though there are no accounts.
This commit is contained in:
@@ -114,16 +114,9 @@ namespace Wino
|
||||
var deferral = e.GetDeferral();
|
||||
|
||||
// Wino should notify user on app close if:
|
||||
// 1. User has at least 1 registered account.
|
||||
// 2. Startup behavior is not Enabled.
|
||||
// 3. Server terminate behavior is set to Terminate.
|
||||
// 1. Startup behavior is not Enabled.
|
||||
// 2. Server terminate behavior is set to Terminate.
|
||||
|
||||
var accountService = Services.GetService<IAccountService>();
|
||||
|
||||
var accounts = await accountService.GetAccountsAsync();
|
||||
|
||||
if (accounts.Count > 0)
|
||||
{
|
||||
// User has some accounts. Check if Wino Server runs on system startup.
|
||||
|
||||
var dialogService = Services.GetService<IDialogService>();
|
||||
@@ -169,6 +162,9 @@ namespace Wino
|
||||
try
|
||||
{
|
||||
var isServerKilled = await _appServiceConnectionManager.GetResponseAsync<bool, TerminateServerRequested>(new TerminateServerRequested());
|
||||
|
||||
isServerKilled.ThrowIfFailed();
|
||||
|
||||
Log.Information("Server is killed.");
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -176,7 +172,6 @@ namespace Wino
|
||||
Log.Error(ex, "Failed to kill server.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
deferral.Complete();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user