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

Cancel old web requests when changing filter modes

This commit is contained in:
Dean Herbert 2018-12-27 18:09:42 +09:00
parent b0e8561ad3
commit d6c53e3851

View File

@ -109,6 +109,8 @@ namespace osu.Game.Screens.Multi
PollImmediately();
}
private GetRoomsRequest pollReq;
protected override Task Poll()
{
if (!api.IsLoggedIn)
@ -116,7 +118,8 @@ namespace osu.Game.Screens.Multi
var tcs = new TaskCompletionSource<bool>();
var pollReq = new GetRoomsRequest(currentFilter.PrimaryFilter);
pollReq?.Cancel();
pollReq = new GetRoomsRequest(currentFilter.PrimaryFilter);
pollReq.Success += result =>
{