1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 16:52:54 +08:00

Check against type instead of channel name

This commit is contained in:
Paul Teng 2019-05-12 06:11:16 -04:00
parent 496a9dd41d
commit d53fb9a5c8
3 changed files with 5 additions and 6 deletions

View File

@ -93,7 +93,7 @@ namespace osu.Game.Tests.Visual.Online
AddUntilStep("remove all channels", () =>
{
var first = channelTabControl.Items.First();
if (first.Name == "+")
if (first is ChannelSelectorTabChannel)
return true;
channelTabControl.RemoveChannel(first);

View File

@ -10,6 +10,7 @@ using osu.Framework.Bindables;
using osu.Framework.Logging;
using osu.Game.Online.API;
using osu.Game.Online.API.Requests;
using osu.Game.Overlays.Chat.Tabs;
using osu.Game.Users;
namespace osu.Game.Online.Chat
@ -86,7 +87,7 @@ namespace osu.Game.Online.Chat
private void currentChannelChanged(ValueChangedEvent<Channel> e)
{
if (e.NewValue?.Name != "+")
if (!(e.NewValue is ChannelSelectorTabChannel))
JoinChannel(e.NewValue);
}

View File

@ -199,10 +199,8 @@ namespace osu.Game.Overlays
return;
}
if (e.NewValue.Name == "+")
{
if (e.NewValue is ChannelSelectorTabChannel)
return;
}
textbox.Current.Disabled = e.NewValue.ReadOnly;
@ -273,7 +271,7 @@ namespace osu.Game.Overlays
private void selectTab(int index)
{
var channel = channelTabControl.Items.Skip(index).FirstOrDefault();
if (channel != null && channel.Name != "+")
if (channel != null && !(channel is ChannelSelectorTabChannel))
channelTabControl.Current.Value = channel;
}