1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-14 03:22:54 +08:00

Better use of loading animation

This commit is contained in:
Andrei Zavatski 2019-08-27 03:53:16 +03:00
parent 8d30c35104
commit cb81d1dd2f

View File

@ -103,7 +103,6 @@ namespace osu.Game.Overlays
Users = null;
clearPanels();
loading.Hide();
getUsersRequest?.Cancel();
if (API?.IsLoggedIn != true)
@ -131,8 +130,13 @@ namespace osu.Game.Overlays
{
clearPanels();
loading.Show();
if (Users == null)
{
loading.Hide();
return;
}
var newPanels = new FillFlowContainer<SocialPanel>
{
@ -167,15 +171,15 @@ namespace osu.Game.Overlays
LoadComponentAsync(newPanels, f =>
{
if (panels != null)
ScrollFlow.Remove(panels);
loading.Hide();
ScrollFlow.Add(panels = newPanels);
});
}
private void updateUsers(IEnumerable<User> newUsers)
{
loading.Show();
var sortDirection = Filter.DisplayStyleControl.Dropdown.Current.Value;
IEnumerable<User> sortedUsers = newUsers;
@ -226,7 +230,6 @@ namespace osu.Game.Overlays
}
Users = sortedUsers;
loading.Hide();
recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value);
}