mirror of
https://github.com/ppy/osu.git
synced 2025-01-06 08:22:56 +08:00
load placeholder page when failed
This commit is contained in:
parent
d1110d00a0
commit
490ce0bbc5
@ -92,7 +92,7 @@ namespace osu.Game.Overlays
|
|||||||
Loading.Show();
|
Loading.Show();
|
||||||
|
|
||||||
request.Success += response => Schedule(() => onSuccess(response));
|
request.Success += response => Schedule(() => onSuccess(response));
|
||||||
request.Failure += _ => Schedule(() => LoadDisplay(Empty()));
|
request.Failure += _ => Schedule(onFail);
|
||||||
|
|
||||||
api.PerformAsync(request);
|
api.PerformAsync(request);
|
||||||
}
|
}
|
||||||
@ -132,6 +132,24 @@ namespace osu.Game.Overlays
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void onFail()
|
||||||
|
{
|
||||||
|
LoadDisplay(new WikiMarkdownContainer
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
CurrentPath = $@"{api.WebsiteRootUrl}/wiki/",
|
||||||
|
Text = "There is something wrong when fetching this page. [Back to main page.](Main_Page)",
|
||||||
|
DocumentMargin = new MarginPadding(0),
|
||||||
|
DocumentPadding = new MarginPadding
|
||||||
|
{
|
||||||
|
Vertical = 20,
|
||||||
|
Left = 30,
|
||||||
|
Right = 50,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private void showParentPage()
|
private void showParentPage()
|
||||||
{
|
{
|
||||||
var parentPath = string.Join("/", path.Value.Split('/').SkipLast(1));
|
var parentPath = string.Join("/", path.Value.Split('/').SkipLast(1));
|
||||||
|
Loading…
Reference in New Issue
Block a user