Files
Piped-Material/src/registerServiceWorker.js
T
root bbd1ce30ec Implement PWA, client-side Watch History and cleanup
Squashed commit of the following:

commit a1c18c7903
Author: root <root@git.maharshi.ninja>
Date:   Sun Aug 22 21:46:45 2021 +0530

    Minor UI change

commit 82783a4fb2
Author: root <root@git.maharshi.ninja>
Date:   Sun Aug 22 21:23:15 2021 +0530

    Format date and time the Right Way (™️)

commit 1b0d87e81d
Author: root <root@git.maharshi.ninja>
Date:   Sun Aug 22 21:17:41 2021 +0530

    A few fixes and a basic implementation

commit 7e5d057d37
Author: root <root@git.maharshi.ninja>
Date:   Sun Aug 22 19:58:10 2021 +0530

    Add PouchDB and add the basic design

commit 16a07c10ff
Author: root <root@git.maharshi.ninja>
Date:   Sun Aug 22 18:53:34 2021 +0530

    Delete robots.txt

commit 83e8690dc5
Author: root <root@git.maharshi.ninja>
Date:   Sun Aug 22 18:52:00 2021 +0530

    Add PWA configuration
2021-08-28 03:27:49 +05:30

33 lines
903 B
JavaScript

/* eslint-disable no-console */
import { register } from 'register-service-worker'
if (process.env.NODE_ENV === 'production') {
register(`${process.env.BASE_URL}service-worker.js`, {
ready () {
console.log(
'App is being served from cache by a service worker.\n' +
'For more details, visit https://goo.gl/AFskqB'
)
},
registered () {
console.log('Service worker has been registered.')
},
cached () {
console.log('Content has been cached for offline use.')
},
updatefound () {
console.log('New content is downloading.')
},
updated () {
console.log('New content is available; please refresh.')
},
offline () {
console.log('No internet connection found. App is running in offline mode.')
},
error (error) {
console.error('Error during service worker registration:', error)
}
})
}