mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-10 07:04:36 +00:00
Updater : Check for api limits and don't bug the user with message dialogs.
This commit is contained in:
parent
1ada2a3b12
commit
795adf9018
1 changed files with 6 additions and 1 deletions
|
@ -28,7 +28,13 @@ namespace Toolbox
|
|||
{
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
|
||||
var client = new GitHubClient(new ProductHeaderValue("ST_UpdateTool"));
|
||||
|
||||
GetReleases(client).Wait();
|
||||
|
||||
var info = client.GetLastApiInfo();
|
||||
if (info != null && info.RateLimit.Remaining <= 0)
|
||||
return;
|
||||
|
||||
GetCommits(client).Wait();
|
||||
|
||||
var asssemblyVersion = Assembly.GetExecutingAssembly().GetName().Version;
|
||||
|
@ -66,7 +72,6 @@ namespace Toolbox
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Toolbox.Library.Forms.STErrorDialog.Show($"Failed to get latest update", "Updater", ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue