1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 13:22:55 +08:00

Revert "Allow OverlayView fetching with no API requests required"

This reverts commit 449b9a21ae.
This commit is contained in:
Salman Ahmed 2020-12-18 01:27:58 +03:00
parent 5d180753fa
commit 5e4f667cff

View File

@ -42,29 +42,25 @@ namespace osu.Game.Overlays
/// <summary>
/// Create the API request for fetching data.
/// </summary>
protected virtual APIRequest<T> CreateRequest() => null;
protected abstract APIRequest<T> CreateRequest();
/// <summary>
/// Fired when results arrive from the main API request.
/// </summary>
/// <param name="response"></param>
protected virtual void OnSuccess(T response)
{
}
protected abstract void OnSuccess(T response);
/// <summary>
/// Force a re-request for data from the API.
/// </summary>
protected virtual void PerformFetch()
protected void PerformFetch()
{
request?.Cancel();
request = CreateRequest();
if (request != null)
{
request.Success += response => Schedule(() => OnSuccess(response));
API.Queue(request);
}
request = CreateRequest();
request.Success += response => Schedule(() => OnSuccess(response));
API.Queue(request);
}
private void onlineStateChanged(ValueChangedEvent<APIState> state) => Schedule(() =>