chore: remove attempt at notifications
This commit is contained in:
@@ -19,63 +19,3 @@ export const wrapRootElement = ({ element }) => {
|
||||
</FirebaseContext.Provider>
|
||||
)
|
||||
}
|
||||
|
||||
export const onServiceWorkerUpdateFound = () => {
|
||||
const showNotification = () => {
|
||||
Notification.requestPermission(result => {
|
||||
if (result === "granted") {
|
||||
navigator.serviceWorker.ready.then(registration => {
|
||||
registration.showNotification("Update", {
|
||||
body: "New content is available!",
|
||||
icon: "../images/sol-journal-logo.png",
|
||||
vibrate: [200, 100, 200, 100, 200, 100, 400],
|
||||
tag: "request",
|
||||
actions: [
|
||||
// you can customize these actions as you like
|
||||
{
|
||||
action: alert("update!"), // you should define this
|
||||
title: "update",
|
||||
},
|
||||
{
|
||||
action: alert("ignore"), // you should define this
|
||||
title: "ignore",
|
||||
},
|
||||
],
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
showNotification()
|
||||
}
|
||||
|
||||
export const onServiceWorkerInstalled = () => {
|
||||
const showNotification = () => {
|
||||
Notification.requestPermission(result => {
|
||||
if (result === "granted") {
|
||||
navigator.serviceWorker.ready.then(registration => {
|
||||
registration.showNotification("Installed", {
|
||||
body: "New content is available!",
|
||||
icon: "../images/sol-journal-logo.png",
|
||||
vibrate: [200, 100, 200, 100, 200, 100, 400],
|
||||
tag: "request",
|
||||
actions: [
|
||||
// you can customize these actions as you like
|
||||
{
|
||||
action: alert("update!"), // you should define this
|
||||
title: "update",
|
||||
},
|
||||
{
|
||||
action: alert("ignore"), // you should define this
|
||||
title: "ignore",
|
||||
},
|
||||
],
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
showNotification()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user