1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 17:52:56 +08:00

Ensure the wrong drawable channel isn't shown after load

This commit is contained in:
Jai Sharma 2022-05-13 23:39:09 +01:00
parent 9f5351e5a1
commit f88e416d1a

View File

@ -264,6 +264,14 @@ namespace osu.Game.Overlays
LoadComponentAsync(drawableChannel, loaded =>
{
// Ensure the current channel hasn't changed by the time the load completes
if (currentChannel.Value != newChannel)
return;
// Ensure the cached reference hasn't been removed from leaving the channel
if (!loadedChannels.ContainsKey(newChannel))
return;
currentChannelContainer.Clear(false);
currentChannelContainer.Add(loaded);
loading.Hide();