mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Prepare changelog api requests to work when not logged in
This commit is contained in:
@ -33,26 +33,31 @@ namespace osu.Game.Overlays.Changelog
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(CancellationToken? cancellation, IAPIProvider api)
|
||||
{
|
||||
var req = new GetChangelogBuildRequest(build.UpdateStream.Name, build.Version);
|
||||
bool complete = false;
|
||||
|
||||
var req = new GetChangelogBuildRequest(build.UpdateStream.Name, build.Version);
|
||||
req.Success += res =>
|
||||
{
|
||||
build = res;
|
||||
complete = true;
|
||||
};
|
||||
|
||||
req.Failure += _ => complete = true;
|
||||
|
||||
api.Queue(req);
|
||||
Task.Run(() => req.Perform(api));
|
||||
|
||||
while (!complete && cancellation?.IsCancellationRequested != true)
|
||||
Task.Delay(1);
|
||||
|
||||
Children = new Drawable[]
|
||||
while (!complete)
|
||||
{
|
||||
new ChangelogBuildWithNavigation(build) { SelectBuild = SelectBuild },
|
||||
};
|
||||
if (cancellation?.IsCancellationRequested == true)
|
||||
{
|
||||
req.Cancel();
|
||||
return;
|
||||
}
|
||||
|
||||
Task.Delay(1);
|
||||
}
|
||||
|
||||
if (build != null)
|
||||
Child = new ChangelogBuildWithNavigation(build) { SelectBuild = SelectBuild };
|
||||
}
|
||||
|
||||
public class ChangelogBuildWithNavigation : ChangelogBuild
|
||||
|
Reference in New Issue
Block a user