Skip to content

Commit

Permalink
Fix bug where Webservices Mod would fail if applied after resetting
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshiask committed May 18, 2024
1 parent fa43aa2 commit 564a00a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ZuneModCore/Mods/WebservicesMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class WebservicesMod : Mod
private const string WEBSERVICE_SUBTITLE_SUCCESS = "OK";
private const string WEBSERVICE_SUBTITLE_UNREACHABLE = "Unreachable";

private readonly HttpClient _client = new();
private HttpClient _client;
private CancellationTokenSource _cts = new();

public override string Id => nameof(WebservicesMod);
Expand Down Expand Up @@ -79,7 +79,10 @@ private static AbstractUIMetadata GetWebserviceAvailabilityUI(string name, strin

public override Task Init()
{
_client.Timeout = TimeSpan.FromSeconds(3);
_client = new()
{
Timeout = TimeSpan.FromSeconds(3)
};

AbstractTextBox newHostBox = (AbstractTextBox)OptionsUI![0];
newHostBox.ValueChanged += OnHostChanged;
Expand Down

0 comments on commit 564a00a

Please sign in to comment.