1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 11:42:56 +08:00

Don't show update button when updates are not feasible

This commit is contained in:
Dean Herbert 2020-06-15 22:19:11 +09:00
parent d2155c3da3
commit 53b7057ee0

View File

@ -30,16 +30,18 @@ namespace osu.Game.Overlays.Settings.Sections.General
Bindable = config.GetBindable<ReleaseStream>(OsuSetting.ReleaseStream),
});
// We should only display the button for UpdateManagers that do check for updates
Add(checkForUpdatesButton = new SettingsButton
if (updateManager.CanCheckForUpdate)
{
Text = "Check for updates",
Action = () =>
Add(checkForUpdatesButton = new SettingsButton
{
checkForUpdatesButton.Enabled.Value = false;
Task.Run(updateManager.CheckForUpdateAsync).ContinueWith(t => Schedule(() => checkForUpdatesButton.Enabled.Value = true));
}
});
Text = "Check for updates",
Action = () =>
{
checkForUpdatesButton.Enabled.Value = false;
Task.Run(updateManager.CheckForUpdateAsync).ContinueWith(t => Schedule(() => checkForUpdatesButton.Enabled.Value = true));
}
});
}
if (RuntimeInfo.IsDesktop)
{