mirror of
https://github.com/kremalicious/blog.git
synced 2024-11-15 09:35:21 +01:00
22 lines
736 B
JavaScript
22 lines
736 B
JavaScript
import './src/styles/global.scss'
|
|
|
|
// IntersectionObserver polyfill for gatsby-image (Safari, IE)
|
|
if (typeof window.IntersectionObserver === 'undefined') {
|
|
import('intersection-observer')
|
|
}
|
|
|
|
import wrapPageElementWithLayout from './src/helpers/wrapPageElement'
|
|
export const wrapPageElement = wrapPageElementWithLayout
|
|
|
|
// Display a message when a service worker updates
|
|
// https://www.gatsbyjs.org/docs/add-offline-support-with-a-service-worker/#displaying-a-message-when-a-service-worker-updates
|
|
export const onServiceWorkerUpdateReady = () => {
|
|
const answer = window.confirm(
|
|
`This application has been updated. ` +
|
|
`Reload to display the latest version?`
|
|
)
|
|
if (answer === true) {
|
|
window.location.reload()
|
|
}
|
|
}
|