Check Notification is supported

This commit is contained in:
Kieran 2023-01-06 15:10:02 +00:00
parent 274f400c7a
commit f56a6f73f4
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
1 changed files with 1 additions and 1 deletions

View File

@ -37,7 +37,7 @@ export default function Layout(props) {
async function goToNotifications(e) {
e.stopPropagation();
// request permissions to send notifications
if (Notification.permission !== "granted") {
if ("Notification" in window && Notification.permission !== "granted") {
try {
let res = await Notification.requestPermission();
console.debug(res);