2023-10-01 14:31:00 +03:00
|
|
|
export function registerServiceWorker() {
|
2023-10-01 22:38:11 +03:00
|
|
|
if("serviceWorker" in navigator) {
|
|
|
|
|
navigator.serviceWorker.register("/sw.js");
|
|
|
|
|
} else {
|
|
|
|
|
console.log("No Service Worker support!");
|
2023-07-17 15:00:40 +03:00
|
|
|
}
|
2023-10-01 14:31:00 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function requestNotificationPermission() {
|
2023-10-01 22:38:11 +03:00
|
|
|
if("PushManager" in window) {
|
|
|
|
|
window.Notification.requestPermission();
|
|
|
|
|
} else {
|
|
|
|
|
console.log("No Push API Support!");
|
2023-07-17 15:00:40 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function windowNotificationPermission() {
|
|
|
|
|
return window.Notification.permission
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function notificationCount() {
|
|
|
|
|
return this.$matrix.notificationCount
|
|
|
|
|
}
|