From 500c7b574848d2b2bc18c776a2206106b654091f Mon Sep 17 00:00:00 2001 From: elseif Date: Fri, 19 Sep 2025 12:27:07 +0800 Subject: [PATCH] Update index.html Signed-off-by: elseif --- index.html | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 3c6d828..221c2cb 100644 --- a/index.html +++ b/index.html @@ -501,11 +501,8 @@ const ghProxyCheckbox = document.getElementById("gh-proxy"); const clearCacheBtn = document.getElementById("clear-cache"); ghProxyCheckbox.checked = localStorage.getItem("gh-proxy-enabled") === "true"; - if (ghProxyCheckbox.checked) { - clearCacheBtn.style.removeProperty("display"); - } else { - clearCacheBtn.style.display = "none"; - } + clearCacheBtn.style.display = ghProxyCheckbox.checked ? "inline-flex" : "none"; + function updateAllDownloadLinks() { document.querySelectorAll('a[href*="github.com/elseif/MikroTikPatch"]').forEach(link => { const isProxyEnabled = localStorage.getItem("gh-proxy-enabled") === "true"; @@ -522,7 +519,7 @@ ghProxyCheckbox.addEventListener("change", () => { localStorage.setItem("gh-proxy-enabled", ghProxyCheckbox.checked ? "true" : "false"); - clearCacheBtn.style.display = ghProxyCheckbox.checked ? "block" : "none"; + clearCacheBtn.style.display = ghProxyCheckbox.checked ? "inline-flex" : "none"; updateAllDownloadLinks(); });