mirror of
https://github.com/ppy/osu.git
synced 2025-01-06 07:02:54 +08:00
CI Style Fixes
This commit is contained in:
parent
cbfa292c05
commit
454c7538c0
@ -219,8 +219,8 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
|
|
||||||
// Want to close channel 2
|
// Want to close channel 2
|
||||||
AddStep("Select channel 2", () => clickDrawable(chatOverlay.TabMap[channel2]));
|
AddStep("Select channel 2", () => clickDrawable(chatOverlay.TabMap[channel2]));
|
||||||
|
AddStep("Press Ctrl + W", pressControlW);
|
||||||
|
|
||||||
AddStep("Press Ctrl + W", () => pressControlW());
|
|
||||||
// Channel 2 should be closed
|
// Channel 2 should be closed
|
||||||
AddAssert("Channel 1 open", () => channelManager.JoinedChannels.Contains(channel1));
|
AddAssert("Channel 1 open", () => channelManager.JoinedChannels.Contains(channel1));
|
||||||
AddAssert("Channel 2 closed", () => !channelManager.JoinedChannels.Contains(channel2));
|
AddAssert("Channel 2 closed", () => !channelManager.JoinedChannels.Contains(channel2));
|
||||||
@ -228,7 +228,7 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
// Want to close channel 1
|
// Want to close channel 1
|
||||||
AddStep("Select channel 1", () => clickDrawable(chatOverlay.TabMap[channel1]));
|
AddStep("Select channel 1", () => clickDrawable(chatOverlay.TabMap[channel1]));
|
||||||
|
|
||||||
AddStep("Press Ctrl + W", () => pressControlW());
|
AddStep("Press Ctrl + W", pressControlW);
|
||||||
// Channel 1 and channel 2 should be closed
|
// Channel 1 and channel 2 should be closed
|
||||||
AddAssert("All channels closed", () => !channelManager.JoinedChannels.Any());
|
AddAssert("All channels closed", () => !channelManager.JoinedChannels.Any());
|
||||||
}
|
}
|
||||||
@ -243,7 +243,8 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Want to join another channel
|
// Want to join another channel
|
||||||
AddStep("Press Ctrl + T", () => pressControlT());
|
AddStep("Press Ctrl + T", pressControlT);
|
||||||
|
|
||||||
// Selector should be visible
|
// Selector should be visible
|
||||||
AddAssert("Selector is visible", () => chatOverlay.SelectionOverlayState == Visibility.Visible);
|
AddAssert("Selector is visible", () => chatOverlay.SelectionOverlayState == Visibility.Visible);
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,6 @@ namespace osu.Game.Online.Chat
|
|||||||
private readonly BindableList<Channel> availableChannels = new BindableList<Channel>();
|
private readonly BindableList<Channel> availableChannels = new BindableList<Channel>();
|
||||||
private readonly BindableList<Channel> joinedChannels = new BindableList<Channel>();
|
private readonly BindableList<Channel> joinedChannels = new BindableList<Channel>();
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Keeps a list of closed channel identifiers. Stores the channel ID for normal
|
/// Keeps a list of closed channel identifiers. Stores the channel ID for normal
|
||||||
/// channels, or the user ID for PM channels
|
/// channels, or the user ID for PM channels
|
||||||
@ -461,8 +460,9 @@ namespace osu.Game.Online.Chat
|
|||||||
closedChannelIds.RemoveAt(closedChannelIds.Count - 1);
|
closedChannelIds.RemoveAt(closedChannelIds.Count - 1);
|
||||||
|
|
||||||
bool lookupCondition(Channel ch) =>
|
bool lookupCondition(Channel ch) =>
|
||||||
ch.Type == ChannelType.PM ? ch.Users.Any(u => u.Id == lastClosedChannelId)
|
ch.Type == ChannelType.PM
|
||||||
: ch.Id == lastClosedChannelId;
|
? ch.Users.Any(u => u.Id == lastClosedChannelId)
|
||||||
|
: ch.Id == lastClosedChannelId;
|
||||||
|
|
||||||
// If the user hasn't already joined the channel, try to join it
|
// If the user hasn't already joined the channel, try to join it
|
||||||
if (joinedChannels.FirstOrDefault(lookupCondition) == null)
|
if (joinedChannels.FirstOrDefault(lookupCondition) == null)
|
||||||
@ -480,6 +480,7 @@ namespace osu.Game.Online.Chat
|
|||||||
req.Success += user => CurrentChannel.Value = JoinChannel(new Channel(user));
|
req.Success += user => CurrentChannel.Value = JoinChannel(new Channel(user));
|
||||||
api.Queue(req);
|
api.Queue(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user