Fixed a lot of "in the wild" problems.

This commit is contained in:
2018-08-02 12:55:50 +02:00
parent d85858b0c1
commit ec576558c8
10 changed files with 59 additions and 41 deletions

View File

@@ -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();
}
}
}