🐛 (notification) fix notification
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
/* eslint-disable no-console */
|
||||
|
||||
import { register } from 'register-service-worker'
|
||||
import { setNotificationInstance } from './utils/notification'
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
register(`${process.env.BASE_URL}service-worker.js`, {
|
||||
ready(sw) {
|
||||
console.log('App is being served from cache by a service worker')
|
||||
sw.showNotification('Session started!', {
|
||||
vibrate: [300, 100, 400]
|
||||
})
|
||||
setNotificationInstance(sw.showNotification)
|
||||
},
|
||||
registered() {
|
||||
console.log('Service worker has been registered.')
|
||||
@@ -21,6 +20,7 @@ if (process.env.NODE_ENV === 'production') {
|
||||
},
|
||||
updated() {
|
||||
console.log('New content is available; please refresh.')
|
||||
location.reload(true)
|
||||
},
|
||||
offline() {
|
||||
console.log(
|
||||
|
||||
Reference in New Issue
Block a user