From 47caddeffed2757c5b3e691e02931bc73faf6d13 Mon Sep 17 00:00:00 2001 From: OmegaRogue Date: Mon, 22 Jan 2024 16:48:05 +0100 Subject: [PATCH] :bug: Fix checkboxes in config menu --- src/renderer.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/renderer.ts b/src/renderer.ts index 00a0187..210b514 100644 --- a/src/renderer.ts +++ b/src/renderer.ts @@ -59,7 +59,7 @@ document.querySelector("#save-app-config").addEventListener("click", (e) => { const backgroundColor = (closeUserConfig.querySelector("#background-color") as HTMLInputElement).value; const textColor = (closeUserConfig.querySelector("#text-color") as HTMLInputElement).value; const cachePath = (closeUserConfig.querySelector("#cache-path") as HTMLInputElement).value; - const autoCacheClear = (closeUserConfig.querySelector("#cache-path") as HTMLInputElement).checked; + const autoCacheClear = (closeUserConfig.querySelector("#clear-cache-on-close") as HTMLInputElement).checked; const ignoreCertificateErrors = (closeUserConfig.querySelector("#insecure-ssl") as HTMLInputElement).checked; const config = { accentColor, @@ -145,6 +145,12 @@ function applyAppConfig(config: AppConfig) { (document.querySelector("#cache-path") as HTMLInputElement).value = config.cachePath; window.api.setCachePath(config.cachePath); } + if (config.ignoreCertificateErrors) { + (document.querySelector("#insecure-ssl") as HTMLInputElement).checked = config.ignoreCertificateErrors; + } + if (config.autoCacheClear) { + (document.querySelector("#clear-cache-on-close") as HTMLInputElement).checked = config.autoCacheClear; + } }