mirror of
https://github.com/ppy/osu
synced 2024-12-25 08:12:41 +00:00
Merge pull request #27033 from frenzibyte/fix-rooms-container-something
Fix selected room bindable being set to null regardless of the removed room
This commit is contained in:
commit
938bbe38b7
@ -64,6 +64,12 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
AddStep("select first room", () => container.Rooms.First().TriggerClick());
|
||||
AddAssert("first spotlight selected", () => checkRoomSelected(RoomManager.Rooms.First(r => r.Category.Value == RoomCategory.Spotlight)));
|
||||
|
||||
AddStep("remove last room", () => RoomManager.RemoveRoom(RoomManager.Rooms.MinBy(r => r.RoomID?.Value)));
|
||||
AddAssert("first spotlight still selected", () => checkRoomSelected(RoomManager.Rooms.First(r => r.Category.Value == RoomCategory.Spotlight)));
|
||||
|
||||
AddStep("remove spotlight room", () => RoomManager.RemoveRoom(RoomManager.Rooms.Single(r => r.Category.Value == RoomCategory.Spotlight)));
|
||||
AddAssert("selection vacated", () => checkRoomSelected(null));
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -152,7 +152,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
roomFlow.RemoveAll(d => d.Room == r, true);
|
||||
|
||||
// selection may have a lease due to being in a sub screen.
|
||||
if (!SelectedRoom.Disabled)
|
||||
if (SelectedRoom.Value == r && !SelectedRoom.Disabled)
|
||||
SelectedRoom.Value = null;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user