🔧 (new version) add listener…

This commit is contained in:
2020-07-25 13:54:55 +02:00
parent f1c7830c27
commit 1a52c521cd

View File

@@ -3,6 +3,7 @@
import { register } from 'register-service-worker'
import { setNotificationInstance, notify } from './utils/notification'
import i18n from '@/i18n'
import { serviceWorkerVersionListener } from 'sw-new-version'
if (process.env.NODE_ENV === 'production') {
register(`${process.env.BASE_URL}service-worker.js`, {
@@ -35,6 +36,7 @@ if (process.env.NODE_ENV === 'production') {
body: i18n.t('notification.update.body').toString(),
tag: 'new-version'
})
serviceWorkerVersionListener.hasNewVersion()
},
offline() {
console.log(