const notif = document.getElementById("notif-panel"); const notbtn = document.getElementById("notbtn"); (async function () { cookie = await cookieStore.get("subscription_endpoint"); if (cookie) { notif.style.display = "none"; } })(); notbtn.addEventListener("click", () => requestPermission()); async function requestPermission() { const sub_result = await subscribe(); if (!sub_result) { return; } notif.style.display = "none"; // this is disgusting if (typeof startbtn !== 'undefined') { startbtn.disabled = false; } }