forked from andyburke/autonomous.contact
refactor: finish UX refactor and move events storage
This commit is contained in:
parent
4347d20263
commit
f760156651
10 changed files with 269 additions and 27 deletions
18
public/js/notifications.js
Normal file
18
public/js/notifications.js
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
const NOTIFICATIONS = {
|
||||
send: function (message, options = {}) {
|
||||
if (!Notification || Notification.permission !== "granted") {
|
||||
return;
|
||||
}
|
||||
|
||||
const notification = new Notification(message, options);
|
||||
return notification;
|
||||
},
|
||||
|
||||
request_permissions: function () {
|
||||
if (Notification && Notification.permission === "granted") {
|
||||
return;
|
||||
}
|
||||
|
||||
Notification.requestPermission();
|
||||
},
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue