Schedule channel manager bindable events to ensure they happen after the first poll

This commit is contained in:
Jai Sharma 2022-05-24 21:25:27 +01:00
parent 60b10fca4e
commit fce527b0df

View File

@ -155,13 +155,15 @@ namespace osu.Game.Overlays
chatHeight.BindValueChanged(height => { Height = height.NewValue; }, true);
currentChannel.BindTo(channelManager.CurrentChannel);
currentChannel.BindValueChanged(currentChannelChanged, true);
joinedChannels.BindTo(channelManager.JoinedChannels);
joinedChannels.BindCollectionChanged(joinedChannelsChanged, true);
availableChannels.BindTo(channelManager.AvailableChannels);
availableChannels.BindCollectionChanged(availableChannelsChanged, true);
Schedule(() =>
{
currentChannel.BindValueChanged(currentChannelChanged, true);
joinedChannels.BindCollectionChanged(joinedChannelsChanged, true);
availableChannels.BindCollectionChanged(availableChannelsChanged, true);
});
channelList.OnRequestSelect += channel => channelManager.CurrentChannel.Value = channel;
channelList.OnRequestLeave += channel => channelManager.LeaveChannel(channel);