Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid sending HTTP requests to the FetchNews URL when FetchNews is disabled #15324

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs
Expand Up @@ -287,7 +287,7 @@ public MainMenuLogic(Widget widget, World world, ModData modData)

void LoadAndDisplayNews(string newsURL, Widget newsBG)
{
if (newsBG != null)
if (newsBG != null && Game.Settings.Game.FetchNews)
{
var cacheFile = Platform.ResolvePath(Platform.SupportDirPrefix, "news.yaml");
var currentNews = ParseNews(cacheFile);
Expand Down
3 changes: 3 additions & 0 deletions OpenRA.Mods.Common/Widgets/Logic/SettingsLogic.cs
Expand Up @@ -492,6 +492,9 @@ Action InitAdvancedPanel(Widget panel)
BindCheckboxPref(panel, "CHECK_VERSION_CHECKBOX", ds, "CheckVersion");
BindCheckboxPref(panel, "REPLAY_COMMANDS_CHECKBOX", ds, "EnableDebugCommandsInReplays");

var ssi = panel.Get<CheckboxWidget>("SENDSYSINFO_CHECKBOX");
ssi.IsDisabled = () => !gs.FetchNews;

return () => { };
}

Expand Down