summaryrefslogtreecommitdiff
path: root/frontend/permissionrequest.js
blob: c6dbd884ca50722f9143c86114681351f83701d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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() {
	subscribe();
	notif.style.display = "none";

	// this is disgusting
	if (typeof startbtn !== 'undefined') {
		startbtn.disabled = false;
	}
}