1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 13:22:55 +08:00

Allow null tracker in lounge screen for tests

This commit is contained in:
Bartłomiej Dach 2020-12-28 22:54:52 +01:00
parent 6dc0f6af50
commit 540dec2e7c

View File

@ -38,7 +38,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
[Resolved]
private MusicController music { get; set; }
[Resolved]
[Resolved(CanBeNull = true)]
private OngoingOperationTracker joiningRoomTracker { get; set; }
[BackgroundDependencyLoader]
@ -102,9 +102,12 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
initialRoomsReceived.BindTo(RoomManager.InitialRoomsReceived);
initialRoomsReceived.BindValueChanged(_ => updateLoadingLayer());
if (joiningRoomTracker != null)
{
joiningRoom.BindTo(joiningRoomTracker.InProgress);
joiningRoom.BindValueChanged(_ => updateLoadingLayer(), true);
}
}
protected override void UpdateAfterChildren()
{
@ -161,15 +164,15 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
private void joinRequested(Room room)
{
joiningRoomTracker.BeginOperation();
joiningRoomTracker?.BeginOperation();
RoomManager?.JoinRoom(room, r =>
{
Open(room);
joiningRoomTracker.EndOperation();
joiningRoomTracker?.EndOperation();
}, _ =>
{
joiningRoomTracker.EndOperation();
joiningRoomTracker?.EndOperation();
});
}