Check Notification is supported
This commit is contained in:
parent
274f400c7a
commit
f56a6f73f4
@ -37,7 +37,7 @@ export default function Layout(props) {
|
|||||||
async function goToNotifications(e) {
|
async function goToNotifications(e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
// request permissions to send notifications
|
// request permissions to send notifications
|
||||||
if (Notification.permission !== "granted") {
|
if ("Notification" in window && Notification.permission !== "granted") {
|
||||||
try {
|
try {
|
||||||
let res = await Notification.requestPermission();
|
let res = await Notification.requestPermission();
|
||||||
console.debug(res);
|
console.debug(res);
|
||||||
|
Loading…
Reference in New Issue
Block a user