1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-20 02:45:38 +08:00

Fix ready-up button getting stuck if server operation fails

This commit is contained in:
Bartłomiej Dach 2020-12-29 09:41:32 +01:00
parent 274730de34
commit cafa241ef3

View File

@ -11,7 +11,6 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Screens;
using osu.Game.Extensions;
using osu.Game.Online.Multiplayer;
using osu.Game.Online.Rooms;
using osu.Game.Screens.OnlinePlay.Components;
@ -218,13 +217,14 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
.ContinueWith(t =>
{
// if gameplay was started, the button will be unblocked on load requested.
if (t.Result) return;
// accessing Exception here also silences any potential errors from the antecedent task
// (we still want to unblock the button if the ready-up fails).
if (t.Exception == null && t.Result) return;
// gameplay was not started; unblock button.
gameplayStartOperation?.Dispose();
gameplayStartOperation = null;
})
.CatchUnobservedExceptions();
});
}
private void onLoadRequested()