mirror of https://github.com/ppy/osu
Avoid showing the external link warning
This commit is contained in:
parent
31abb372e5
commit
465e7d29fe
|
@ -157,7 +157,7 @@ private void beginMigration()
|
|||
Text = "IMPORTANT: During data migration, some of your data could not be successfully migrated. The previous version has been backed up.\n\nFor further assistance, please open a discussion on github and attach your backup files (click to get started).",
|
||||
Activated = () =>
|
||||
{
|
||||
game.OpenUrlExternally(@"https://github.com/ppy/osu/discussions/new?title=Realm%20migration%20issue&body=Please%20drag%20the%20""attach_me.zip""%20file%20here!&category=q-a");
|
||||
game.OpenUrlExternally(@"https://github.com/ppy/osu/discussions/new?title=Realm%20migration%20issue&body=Please%20drag%20the%20""attach_me.zip""%20file%20here!&category=q-a", true);
|
||||
|
||||
const string attachment_filename = "attach_me.zip";
|
||||
const string backup_folder = "backups";
|
||||
|
|
|
@ -27,9 +27,9 @@ private void load(OsuConfigManager config)
|
|||
externalLinkWarning = config.GetBindable<bool>(OsuSetting.ExternalLinkWarning);
|
||||
}
|
||||
|
||||
public void OpenUrlExternally(string url)
|
||||
public void OpenUrlExternally(string url, bool bypassWarning = false)
|
||||
{
|
||||
if (externalLinkWarning.Value)
|
||||
if (!bypassWarning && externalLinkWarning.Value)
|
||||
dialogOverlay.Push(new ExternalLinkDialog(url, () => host.OpenUrlExternally(url)));
|
||||
else
|
||||
host.OpenUrlExternally(url);
|
||||
|
|
|
@ -357,12 +357,12 @@ public void HandleLink(LinkDetails link) => Schedule(() =>
|
|||
}
|
||||
});
|
||||
|
||||
public void OpenUrlExternally(string url) => waitForReady(() => externalLinkOpener, _ =>
|
||||
public void OpenUrlExternally(string url, bool bypassExternalUrlWarning = false) => waitForReady(() => externalLinkOpener, _ =>
|
||||
{
|
||||
if (url.StartsWith('/'))
|
||||
url = $"{API.APIEndpointUrl}{url}";
|
||||
|
||||
externalLinkOpener.OpenUrlExternally(url);
|
||||
externalLinkOpener.OpenUrlExternally(url, bypassExternalUrlWarning);
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue