mirror of
https://github.com/mmjee/Piped-Material.git
synced 2024-12-06 19:26:36 +01:00
bbd1ce30ec
Squashed commit of the following: commita1c18c7903Author: root <root@git.maharshi.ninja> Date: Sun Aug 22 21:46:45 2021 +0530 Minor UI change commit82783a4fb2Author: root <root@git.maharshi.ninja> Date: Sun Aug 22 21:23:15 2021 +0530 Format date and time the Right Way (™️) commit1b0d87e81dAuthor: root <root@git.maharshi.ninja> Date: Sun Aug 22 21:17:41 2021 +0530 A few fixes and a basic implementation commit7e5d057d37Author: root <root@git.maharshi.ninja> Date: Sun Aug 22 19:58:10 2021 +0530 Add PouchDB and add the basic design commit16a07c10ffAuthor: root <root@git.maharshi.ninja> Date: Sun Aug 22 18:53:34 2021 +0530 Delete robots.txt commit83e8690dc5Author: root <root@git.maharshi.ninja> Date: Sun Aug 22 18:52:00 2021 +0530 Add PWA configuration
33 lines
903 B
JavaScript
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)
|
|
}
|
|
})
|
|
}
|