1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 22:07:25 +08:00

Fix wiki links containing locale not loading when opened from chat.

This commit is contained in:
Riley Quinn 2022-03-03 22:30:08 -06:00
parent 7be2d94b6a
commit 81a49057ec
No known key found for this signature in database
GPG Key ID: C51D68464AD87CE4

View File

@ -7,6 +7,7 @@ using System.Threading;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Game.Extensions;
using osu.Game.Online.API;
using osu.Game.Online.API.Requests;
using osu.Game.Online.API.Requests.Responses;
@ -100,7 +101,16 @@ namespace osu.Game.Overlays
cancellationToken?.Cancel();
request?.Cancel();
request = new GetWikiRequest(e.NewValue);
string[] values = e.NewValue.Split('/', 2);
if (values.Length > 1 && LanguageExtensions.TryParseCultureCode(values[0], out _))
{
request = new GetWikiRequest(values[1], values[0]);
}
else
{
request = new GetWikiRequest(e.NewValue);
}
Loading.Show();