diff options
| author | altaf-creator <dev@altafcreator.com> | 2025-12-01 18:02:59 +0700 |
|---|---|---|
| committer | altaf-creator <dev@altafcreator.com> | 2025-12-01 18:02:59 +0700 |
| commit | 182720dc2e9bcdc780194307629157efbb9d8578 (patch) | |
| tree | 1411b00c065e3b8194303bb6c0030eea1ef81ba2 | |
| parent | a3900c134c4ecef5ebbf100bd85119a4da9be5cd (diff) | |
testing; don't bother reading the docs
| -rw-r--r-- | frontend/start.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/frontend/start.js b/frontend/start.js index f79033d..21c5a6d 100644 --- a/frontend/start.js +++ b/frontend/start.js @@ -10,9 +10,10 @@ startUpdateMachines(); const notbtn = document.getElementById("notbtn") notbtn.addEventListener("click", () => requestPermission()) -function requestPermission() { +async function requestPermission() { console.log("Requesting permission..."); - OneSignal.Notifications.requestPermission(); + const onesig_res = await OneSignal.Notifications.requestPermission(); + alert(onesig_res); } const notif = document.getElementById("notif-panel"); if (Notification.permission == 'granted') { |
