From 6662b06dbe499fded03825467645850ec72644ae Mon Sep 17 00:00:00 2001 From: Gabriel Garcia Date: Wed, 20 Mar 2024 23:18:00 -0400 Subject: [PATCH] No need to wait for the async requests, prevents locking up the UI in case a bad IP is configured --- AutoKeyLight/MainForm.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AutoKeyLight/MainForm.cs b/AutoKeyLight/MainForm.cs index 04270a6..96857d6 100644 --- a/AutoKeyLight/MainForm.cs +++ b/AutoKeyLight/MainForm.cs @@ -210,7 +210,7 @@ private void CameraIsOn() StringContent httpContent = new StringContent("{\"lights\": [{\"on\": 1}]}", Encoding.UTF8, "application/json"); try { - httpClient.PutAsync(keylightURL, httpContent).Wait(); + httpClient.PutAsync(keylightURL, httpContent); } catch { } } @@ -234,7 +234,7 @@ private void CameraIsOff() try { - httpClient.PutAsync(keylightURL, httpContent).Wait(); + httpClient.PutAsync(keylightURL, httpContent); } catch { } }