🐛 (notif)

This commit is contained in:
2020-07-02 13:23:39 +02:00
parent 4c3c657e8b
commit 7f78971377

View File

@@ -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(