Fixed a lot of "in the wild" problems.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
@@ -13,7 +12,6 @@ namespace Katteker
|
||||
public static class UserInterface
|
||||
{
|
||||
private static UpdateManager _manager;
|
||||
private static Action _restartApp;
|
||||
|
||||
/// <summary>
|
||||
/// Checks for Updates.
|
||||
@@ -40,8 +38,7 @@ namespace Katteker
|
||||
}
|
||||
|
||||
var releases = (await _manager.CheckForUpdateAsync().ConfigureAwait(false)).ToArray();
|
||||
_restartApp = () => _manager.RestartApp();
|
||||
if (releases.Any() || !isStartup)
|
||||
if (releases.Length > 0 || !isStartup)
|
||||
{
|
||||
var thread = new Thread(ThreadProcess);
|
||||
thread.SetApartmentState(ApartmentState.STA);
|
||||
@@ -58,7 +55,7 @@ namespace Katteker
|
||||
var dialogResult = window.ShowDialog();
|
||||
if (dialogResult == DialogResult.OK)
|
||||
{
|
||||
_restartApp?.Invoke();
|
||||
_manager.RestartApp();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user