1
0
mirror of synced 2025-03-01 16:10:52 +01:00

Fix updater

This commit is contained in:
KillzXGaming 2019-08-15 17:09:07 -04:00
parent 751c1dc550
commit 50b76223b8
2 changed files with 21 additions and 19 deletions

View File

@ -92,6 +92,11 @@ namespace Toolbox
version.SaveVersionInfo();
}
ThreadStart t = new ThreadStart(UpdateProgram.CheckLatest);
Thread thread = new Thread(t);
thread.Start();
Application.Idle += Application_Idle;
if (Runtime.UseOpenGL)
{

View File

@ -12,7 +12,7 @@ namespace Toolbox
{
public class UpdateProgram
{
static List<Release> Releases;
static Release[] releases;
public static bool CanUpdate = false;
public static bool Downloaded = false;
public static Release LatestRelease;
@ -28,7 +28,7 @@ namespace Toolbox
GetReleases(client).Wait();
GetCommits(client).Wait();
foreach (Release latest in Releases)
foreach (Release latest in releases)
{
Console.WriteLine(
"The latest release is tagged at {0} and is named {1} commit {2} date {3}",
@ -56,10 +56,6 @@ namespace Toolbox
}
break;
}
Releases.Clear();
CommitList.Clear();
client = null;
}
catch (Exception ex)
{
@ -121,9 +117,10 @@ namespace Toolbox
static async Task GetReleases(GitHubClient client)
{
Releases.Clear();
List<Release> Releases = new List<Release>();
foreach (Release r in await client.Repository.Release.GetAll("KillzXGaming", "Switch-Toolbox"))
Releases.Add(r);
releases = Releases.ToArray();
}
}
}