mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 18:42:56 +08:00
Check against the loaded drawable channel
This commit is contained in:
parent
bd68ffa805
commit
371738b047
@ -263,18 +263,18 @@ namespace osu.Game.Overlays
|
||||
ChatOverlayDrawableChannel drawableChannel = new ChatOverlayDrawableChannel(newChannel);
|
||||
loadedChannels.Add(newChannel, drawableChannel);
|
||||
|
||||
LoadComponentAsync(drawableChannel, loaded =>
|
||||
LoadComponentAsync(drawableChannel, loadedDrawable =>
|
||||
{
|
||||
// Ensure the current channel hasn't changed by the time the load completes
|
||||
if (currentChannel.Value != newChannel)
|
||||
if (currentChannel.Value != loadedDrawable.Channel)
|
||||
return;
|
||||
|
||||
// Ensure the cached reference hasn't been removed from leaving the channel
|
||||
if (!loadedChannels.ContainsKey(newChannel))
|
||||
if (!loadedChannels.ContainsKey(loadedDrawable.Channel))
|
||||
return;
|
||||
|
||||
currentChannelContainer.Clear(false);
|
||||
currentChannelContainer.Add(loaded);
|
||||
currentChannelContainer.Add(loadedDrawable);
|
||||
loading.Hide();
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user