mirror of
https://github.com/ppy/osu
synced 2024-12-14 19:06:07 +00:00
remove unnecessary task + rename method
This commit is contained in:
parent
a00f92dcb4
commit
313dfd4d46
@ -163,28 +163,25 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
case SocialTab.OnlinePlayers:
|
case SocialTab.OnlinePlayers:
|
||||||
var userRequest = new GetUsersRequest(); // TODO filter???
|
var userRequest = new GetUsersRequest(); // TODO filter???
|
||||||
userRequest.Success += response => finishRequest(response.Select(r => r.User));
|
userRequest.Success += response => updateUsers(response.Select(r => r.User));
|
||||||
api.Queue(getUsersRequest = userRequest);
|
api.Queue(getUsersRequest = userRequest);
|
||||||
break;
|
break;
|
||||||
case SocialTab.OnlineFriends:
|
case SocialTab.OnlineFriends:
|
||||||
var friendRequest = new GetFriendsRequest(); // TODO filter???
|
var friendRequest = new GetFriendsRequest(); // TODO filter???
|
||||||
friendRequest.Success += finishRequest;
|
friendRequest.Success += updateUsers;
|
||||||
api.Queue(getUsersRequest = friendRequest);
|
api.Queue(getUsersRequest = friendRequest);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
loading.Show();
|
loading.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void finishRequest(IEnumerable<User> newUsers)
|
private void updateUsers(IEnumerable<User> newUsers)
|
||||||
{
|
{
|
||||||
Task.Run(() =>
|
Schedule(() =>
|
||||||
{
|
{
|
||||||
Schedule(() =>
|
Users = newUsers;
|
||||||
{
|
recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value);
|
||||||
Users = newUsers;
|
loading.Hide();
|
||||||
recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value);
|
|
||||||
loading.Hide();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user