1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-03 05:30:11 +08:00

Avoid calling api request callback after user cancel

This commit is contained in:
Dean Herbert
2019-06-25 13:52:43 +09:00
Unverified
parent 109ca1fd6f
commit 90acc9b6ca
+6 -1
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"));