From b4f473a45ab1b8ea29aa6c0818bdedf082a816ab Mon Sep 17 00:00:00 2001 From: 0neGal Date: Thu, 9 Mar 2023 16:33:03 +0100 Subject: fixed changing language not disabling autolang --- src/app/js/settings.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/app/js/settings.js b/src/app/js/settings.js index 645a9ed..20cd4b6 100644 --- a/src/app/js/settings.js +++ b/src/app/js/settings.js @@ -99,14 +99,23 @@ var Settings = { ipcRenderer.on("cant-autoupdate", () => { document.querySelector(".option[name=autoupdate]").style.display = "none"; }) + }, + switch: (el, state) => { + if (state) { + return el.classList.add("on"); + } else if (state === false) { + return el.classList.remove("on"); + } + + if (el.classList.contains("switch") && el.tagName == "BUTTON") { + el.classList.toggle("on"); + } } } document.body.addEventListener("click", (e) => { let el = document.elementFromPoint(e.clientX, e.clientY); - if (el.classList.contains("switch") && el.tagName == "BUTTON") { - el.classList.toggle("on"); - } + Settings.switch(el); }) Settings.load(); -- cgit v1.2.3