Reset currentRoom state when cancelling room creation

This commit is contained in:
Jamie Taylor
2019-03-06 17:13:41 +09:00
parent 8a69fc5534
commit 5de6e29294

View File

@ -53,6 +53,9 @@ namespace osu.Game.Screens.Multi.Match
private MatchLeaderboard leaderboard;
[Resolved]
private Bindable<Room> currentRoom { get; set; }
public MatchSubScreen(Room room)
{
Title = room.RoomID.Value == null ? "New room" : room.Name.Value;
@ -182,6 +185,10 @@ namespace osu.Game.Screens.Multi.Match
public override bool OnExiting(IScreen next)
{
RoomManager?.PartRoom();
if (roomId.Value == null)
currentRoom.Value = new Room();
return base.OnExiting(next);
}