diff --git a/gatsby-browser.js b/gatsby-browser.js index ddce947..68d5438 100644 --- a/gatsby-browser.js +++ b/gatsby-browser.js @@ -19,63 +19,3 @@ export const wrapRootElement = ({ element }) => { ) } - -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() -}