diff --git a/js/switch-deploy.js b/js/switch-deploy.js index 445ae82b..d69e70b3 100644 --- a/js/switch-deploy.js +++ b/js/switch-deploy.js @@ -3,9 +3,7 @@ const button = document.getElementById("switch-deploy-button"); button.addEventListener("click", () => { const currentUrl = window.location.href; - if (currentUrl.includes("/main")) { - window.location.href = currentUrl.replace("/main", "/release"); - } else if (currentUrl.includes("/release")) { + if (currentUrl.includes("/release")) { window.location.href = currentUrl.replace("/release", "/main"); } else { window.location.href = "https://key4hep.github.io/eede/release/index.html"; @@ -13,9 +11,7 @@ button.addEventListener("click", () => { }); const url = window.location.href; -if (url.includes("/main")) { - button.innerText = "Release"; -} else if (url.includes("/release")) { +if (url.includes("/release")) { button.innerText = "Main"; } else { button.innerText = "Release";