1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 17:02:55 +08:00

Merge pull request #5143 from peppy/cancel-api-callback

Avoid calling api request callback after user cancel
This commit is contained in:
Dan Balasescu 2019-06-25 19:04:57 +09:00 committed by GitHub
commit 2d07514a56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,7 +88,12 @@ namespace osu.Game.Online.API
if (checkAndScheduleFailure())
return;
API.Schedule(delegate { Success?.Invoke(); });
API.Schedule(delegate
{
if (cancelled) return;
Success?.Invoke();
});
}
public void Cancel() => Fail(new OperationCanceledException(@"Request cancelled"));