1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-05 10:45:36 +08:00

Merge pull request #30812 from smoogipoo/playlist-populate-on-enter

Fix joining playlists room sometimes not selecting the first item
This commit is contained in:
Dean Herbert 2024-11-22 23:57:45 +09:00 committed by GitHub
commit ce41c000a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 3 deletions

View File

@ -7,7 +7,7 @@ using osu.Game.Online.API;
namespace osu.Game.Online.Rooms
{
public class JoinRoomRequest : APIRequest
public class JoinRoomRequest : APIRequest<Room>
{
public readonly Room Room;
public readonly string? Password;

View File

@ -72,9 +72,13 @@ namespace osu.Game.Screens.OnlinePlay.Components
currentJoinRoomRequest?.Cancel();
currentJoinRoomRequest = new JoinRoomRequest(room, password);
currentJoinRoomRequest.Success += () =>
currentJoinRoomRequest.Success += result =>
{
joinedRoom.Value = room;
AddOrUpdateRoom(result);
room.CopyFrom(result); // Also copy back to the source model, since this is likely to have been stored elsewhere.
onSuccess?.Invoke(room);
};

View File

@ -71,7 +71,7 @@ namespace osu.Game.Tests.Visual.OnlinePlay
return true;
}
joinRoomRequest.TriggerSuccess();
joinRoomRequest.TriggerSuccess(createResponseRoom(room, true));
return true;
}