Skip to content

Commit

Permalink
Pass through correct update to apply when calling `WaitExitThenApplyU…
Browse files Browse the repository at this point in the history
…pdates`
  • Loading branch information
peppy committed Sep 2, 2024
1 parent 68e6fa2 commit cd9b822
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions osu.Desktop/Updater/VelopackUpdateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private async Task<bool> checkForUpdateAsync(UpdateProgressNotification? notific
if (localUserInfo?.IsPlaying.Value == true)
return false;

var info = await updateManager.CheckForUpdatesAsync().ConfigureAwait(false);
UpdateInfo? info = await updateManager.CheckForUpdatesAsync().ConfigureAwait(false);

// Handle no updates available.
if (info == null)
Expand All @@ -65,7 +65,7 @@ private async Task<bool> checkForUpdateAsync(UpdateProgressNotification? notific
{
Activated = () =>
{
restartToApplyUpdate();
restartToApplyUpdate(null);
return true;
}
});
Expand All @@ -78,7 +78,7 @@ private async Task<bool> checkForUpdateAsync(UpdateProgressNotification? notific
{
notification = new UpdateProgressNotification
{
CompletionClickAction = restartToApplyUpdate,
CompletionClickAction = () => restartToApplyUpdate(info),
};

Schedule(() => notificationOverlay.Post(notification));
Expand Down Expand Up @@ -117,9 +117,9 @@ private async Task<bool> checkForUpdateAsync(UpdateProgressNotification? notific
return true;
}

private bool restartToApplyUpdate()
private bool restartToApplyUpdate(UpdateInfo? info)
{
updateManager.WaitExitThenApplyUpdates(null);
updateManager.WaitExitThenApplyUpdates(info?.TargetFullRelease);
Schedule(() => game.AttemptExit());
return true;
}
Expand Down

0 comments on commit cd9b822

Please sign in to comment.