Skip to content

Commit

Permalink
Switched "Updater" module to correct async+await usage.
Browse files Browse the repository at this point in the history
Closes #563.
  • Loading branch information
xvitaly committed Jul 18, 2023
1 parent 79264b5 commit 9f1be99
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/srcrepair/FrmUpdate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ private void UpdateTimeSetApp()
/// Launches a program update checker in a separate thread, waits for the
/// result and returns a message if found.
/// </summary>
private async void CheckForUpdates()
private async Task CheckForUpdates()
{
try
{
if (await CheckForUpdatesTask(UserAgent))
if (await IsUpdatesAvailable(UserAgent))
{
UpdAppImg.Image = Properties.Resources.IconUpdateAvailable;
UpdAppStatus.Text = string.Format(AppStrings.UPD_AppUpdateAvail, UpMan.AppUpdateVersion);
Expand All @@ -110,7 +110,7 @@ private async void CheckForUpdates()
/// </summary>
/// <param name="UA">User-Agent header for outgoing HTTP queries.</param>
/// <returns>Returns True if updates were found.</returns>
private async Task<bool> CheckForUpdatesTask(string UA)
private async Task<bool> IsUpdatesAvailable(string UA)
{
UpMan = await UpdateManager.Create(UA);
return UpMan.CheckAppUpdate();
Expand Down Expand Up @@ -197,10 +197,10 @@ private bool InstallBinaryUpdate(string UpdateURL)
/// </summary>
/// <param name="sender">Sender object.</param>
/// <param name="e">Event arguments.</param>
private void FrmUpdate_Load(object sender, EventArgs e)
private async void FrmUpdate_Load(object sender, EventArgs e)
{
// Starting checking for updates...
CheckForUpdates();
await CheckForUpdates();
}

/// <summary>
Expand Down

0 comments on commit 9f1be99

Please sign in to comment.