mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:57:39 +08:00
Merge pull request #764 from peppy/fix-duplicate-channels
Fix duplicate channels being created on connection loss
This commit is contained in:
commit
3a12fbd581
@ -284,10 +284,21 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
if (channel == null) return;
|
||||
|
||||
careChannels.Add(channel);
|
||||
channelTabs.AddItem(channel);
|
||||
var existing = careChannels.Find(c => c.Id == channel.Id);
|
||||
|
||||
// we need to get a good number of messages initially for each channel we care about.
|
||||
if (existing != null)
|
||||
{
|
||||
// if we already have this channel loaded, we don't want to make a second one.
|
||||
channel = existing;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
careChannels.Add(channel);
|
||||
channelTabs.AddItem(channel);
|
||||
}
|
||||
|
||||
// let's fetch a small number of messages to bring us up-to-date with the backlog.
|
||||
fetchInitialMessages(channel);
|
||||
|
||||
if (CurrentChannel == null)
|
||||
|
Loading…
Reference in New Issue
Block a user