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)
|
if (localUserInfo?.IsPlaying.Value == true)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var info = await updateManager.CheckForUpdatesAsync().ConfigureAwait(false);
|
UpdateInfo? info = await updateManager.CheckForUpdatesAsync().ConfigureAwait(false);
|
||||||
|
|
||||||
// Handle no updates available.
|
// Handle no updates available.
|
||||||
if (info == null)
|
if (info == null)
|
||||||
|
@ -65,7 +65,7 @@ private async Task<bool> checkForUpdateAsync(UpdateProgressNotification? notific
|
||||||
{
|
{
|
||||||
Activated = () =>
|
Activated = () =>
|
||||||
{
|
{
|
||||||
restartToApplyUpdate();
|
restartToApplyUpdate(null);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -78,7 +78,7 @@ private async Task<bool> checkForUpdateAsync(UpdateProgressNotification? notific
|
||||||
{
|
{
|
||||||
notification = new UpdateProgressNotification
|
notification = new UpdateProgressNotification
|
||||||
{
|
{
|
||||||
CompletionClickAction = restartToApplyUpdate,
|
CompletionClickAction = () => restartToApplyUpdate(info),
|
||||||
};
|
};
|
||||||
|
|
||||||
Schedule(() => notificationOverlay.Post(notification));
|
Schedule(() => notificationOverlay.Post(notification));
|
||||||
|
@ -117,9 +117,9 @@ private async Task<bool> checkForUpdateAsync(UpdateProgressNotification? notific
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool restartToApplyUpdate()
|
private bool restartToApplyUpdate(UpdateInfo? info)
|
||||||
{
|
{
|
||||||
updateManager.WaitExitThenApplyUpdates(null);
|
updateManager.WaitExitThenApplyUpdates(info?.TargetFullRelease);
|
||||||
Schedule(() => game.AttemptExit());
|
Schedule(() => game.AttemptExit());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue