mirror of https://github.com/ppy/osu
Pass through correct update to apply when calling `WaitExitThenApplyUpdates`
This commit is contained in:
parent
68e6fa286e
commit
cd9b82253e
|
@ -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)
|
||||
|
@ -65,7 +65,7 @@ private async Task<bool> checkForUpdateAsync(UpdateProgressNotification? notific
|
|||
{
|
||||
Activated = () =>
|
||||
{
|
||||
restartToApplyUpdate();
|
||||
restartToApplyUpdate(null);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
@ -78,7 +78,7 @@ private async Task<bool> checkForUpdateAsync(UpdateProgressNotification? notific
|
|||
{
|
||||
notification = new UpdateProgressNotification
|
||||
{
|
||||
CompletionClickAction = restartToApplyUpdate,
|
||||
CompletionClickAction = () => restartToApplyUpdate(info),
|
||||
};
|
||||
|
||||
Schedule(() => notificationOverlay.Post(notification));
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue