From 760d2aff4bdbd73f33ac10a9ed0858048657220f Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Sat, 30 Dec 2017 12:56:18 +0100 Subject: [PATCH] readd IOnlineComponent to be able to react to APIState changes --- osu.Game/Overlays/SocialOverlay.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/SocialOverlay.cs b/osu.Game/Overlays/SocialOverlay.cs index a65e2f9e77..3dafecc6df 100644 --- a/osu.Game/Overlays/SocialOverlay.cs +++ b/osu.Game/Overlays/SocialOverlay.cs @@ -21,7 +21,7 @@ using System.Threading.Tasks; namespace osu.Game.Overlays { - public class SocialOverlay : SearchableListOverlay + public class SocialOverlay : SearchableListOverlay, IOnlineComponent { private APIAccess api; @@ -90,6 +90,7 @@ namespace osu.Game.Overlays private void load(APIAccess api) { this.api = api; + api.Register(this); } private void recreatePanels(PanelDisplayStyle displayStyle) @@ -187,6 +188,20 @@ namespace osu.Game.Overlays }); }); } + + public void APIStateChanged(APIAccess api, APIState state) + { + switch (state) + { + case APIState.Online: + Scheduler.AddOnce(updateSearch); + break; + default: + Users = null; + recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value); + break; + } + } } public enum SortDirection