🐛 (notif)
This commit is contained in:
@@ -7,7 +7,9 @@ if (process.env.NODE_ENV === 'production') {
|
|||||||
register(`${process.env.BASE_URL}service-worker.js`, {
|
register(`${process.env.BASE_URL}service-worker.js`, {
|
||||||
ready(sw) {
|
ready(sw) {
|
||||||
console.log('App is being served from cache by a service worker')
|
console.log('App is being served from cache by a service worker')
|
||||||
setNotificationInstance(sw.showNotification)
|
setNotificationInstance((title, options?) =>
|
||||||
|
sw.showNotification(title, options)
|
||||||
|
)
|
||||||
},
|
},
|
||||||
registered() {
|
registered() {
|
||||||
console.log('Service worker has been registered.')
|
console.log('Service worker has been registered.')
|
||||||
@@ -20,7 +22,6 @@ if (process.env.NODE_ENV === 'production') {
|
|||||||
},
|
},
|
||||||
updated() {
|
updated() {
|
||||||
console.log('New content is available; please refresh.')
|
console.log('New content is available; please refresh.')
|
||||||
location.reload(true)
|
|
||||||
},
|
},
|
||||||
offline() {
|
offline() {
|
||||||
console.log(
|
console.log(
|
||||||
|
|||||||
Reference in New Issue
Block a user