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

Expose Fetch method

This commit is contained in:
Andrei Zavatski 2020-03-21 20:37:21 +03:00
parent d241f7c55f
commit 2b0c267cb9
2 changed files with 4 additions and 6 deletions

View File

@ -10,7 +10,6 @@ using osu.Game.Users;
using osu.Game.Overlays; using osu.Game.Overlays;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using NUnit.Framework; using NUnit.Framework;
using osu.Game.Online.API;
namespace osu.Game.Tests.Visual.Online namespace osu.Game.Tests.Visual.Online
{ {
@ -28,9 +27,6 @@ namespace osu.Game.Tests.Visual.Online
[Cached] [Cached]
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Purple); private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Purple);
[Resolved]
private IAPIProvider api { get; set; }
private FriendsLayout layout; private FriendsLayout layout;
[SetUp] [SetUp]
@ -52,6 +48,7 @@ namespace osu.Game.Tests.Visual.Online
[Test] [Test]
public void TestOnline() public void TestOnline()
{ {
AddStep("Fetch online", () => layout?.Fetch());
} }
private List<User> getUsers() => new List<User> private List<User> getUsers() => new List<User>

View File

@ -25,8 +25,6 @@ namespace osu.Game.Overlays.Dashboard.Friends
get => users; get => users;
set set
{ {
request?.Cancel();
users = value; users = value;
onlineStatusControl.Populate(value); onlineStatusControl.Populate(value);
@ -152,7 +150,10 @@ namespace osu.Game.Overlays.Dashboard.Friends
onlineStatusControl.Current.BindValueChanged(_ => recreatePanels()); onlineStatusControl.Current.BindValueChanged(_ => recreatePanels());
userListToolbar.DisplayStyle.BindValueChanged(_ => recreatePanels()); userListToolbar.DisplayStyle.BindValueChanged(_ => recreatePanels());
userListToolbar.SortCriteria.BindValueChanged(_ => recreatePanels()); userListToolbar.SortCriteria.BindValueChanged(_ => recreatePanels());
}
public void Fetch()
{
if (!api.IsLoggedIn) if (!api.IsLoggedIn)
return; return;