Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix joining playlists room sometimes not selecting the first item #30812

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

smoogipoo
Copy link
Contributor

Prereqs:

When the room is joined and has a non-null ID, the playlists subscreen expects the playlist to be populated to select the first item:

private void updateSetupState()
{
if (Room.RoomID != null)
{
// Set the first playlist item.
// This is scheduled since updating the room and playlist may happen in an arbitrary order (via Room.CopyFrom()).
Schedule(() => SelectedItem.Value = Room.Playlist.FirstOrDefault());
}
}

This will now be possible after the above osu!web change.

Comment on lines +79 to +80
AddOrUpdateRoom(result);
room.CopyFrom(result); // Also copy back to the source model, since this is likely to have been stored elsewhere.
Copy link
Contributor Author

@smoogipoo smoogipoo Nov 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a char-for-char copy of CreateRoom(). I think everything continues to work correctly without the room.CopyFrom() line, as opposed to CreateRoom() which requires it, but I hope to remove both cases of this in the future.

Just keeping it around to keep things uniform. Can remove if desired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant