diff --git a/osu.Game/Screens/OnlinePlay/Lounge/LoungeSubScreen.cs b/osu.Game/Screens/OnlinePlay/Lounge/LoungeSubScreen.cs index 04ea59621d..fc4a5357c6 100644 --- a/osu.Game/Screens/OnlinePlay/Lounge/LoungeSubScreen.cs +++ b/osu.Game/Screens/OnlinePlay/Lounge/LoungeSubScreen.cs @@ -297,29 +297,26 @@ namespace osu.Game.Screens.OnlinePlay.Lounge popoverContainer.HidePopover(); } - public void Join(Room room, string password, Action onSuccess = null, Action onFailure = null) + public virtual void Join(Room room, string password, Action onSuccess = null, Action onFailure = null) => Schedule(() => { - Schedule(() => + if (joiningRoomOperation != null) + return; + + joiningRoomOperation = ongoingOperationTracker?.BeginOperation(); + + RoomManager?.JoinRoom(room, password, _ => { - if (joiningRoomOperation != null) - return; - - joiningRoomOperation = ongoingOperationTracker?.BeginOperation(); - - RoomManager?.JoinRoom(room, password, _ => - { - Open(room); - joiningRoomOperation?.Dispose(); - joiningRoomOperation = null; - onSuccess?.Invoke(room); - }, error => - { - joiningRoomOperation?.Dispose(); - joiningRoomOperation = null; - onFailure?.Invoke(error); - }); + Open(room); + joiningRoomOperation?.Dispose(); + joiningRoomOperation = null; + onSuccess?.Invoke(room); + }, error => + { + joiningRoomOperation?.Dispose(); + joiningRoomOperation = null; + onFailure?.Invoke(error); }); - } + }); /// /// Copies a room and opens it as a fresh (not-yet-created) one.