2019-04-28 22:30:20 +02:00
|
|
|
import wrapPageElementWithLayout from './src/helpers/wrapPageElement'
|
|
|
|
|
|
|
|
// Global styles
|
|
|
|
import './src/styles/global.scss'
|
2018-06-23 14:36:07 +02:00
|
|
|
|
2018-09-14 18:27:49 +02:00
|
|
|
// IntersectionObserver polyfill for gatsby-image (Safari, IE)
|
|
|
|
if (typeof window !== 'undefined' && !window.IntersectionObserver) {
|
|
|
|
import('intersection-observer')
|
2018-06-23 14:36:07 +02:00
|
|
|
}
|
2018-09-14 18:27:49 +02:00
|
|
|
|
2019-04-28 22:30:20 +02:00
|
|
|
// Layout with Page Transitions
|
|
|
|
export const wrapPageElement = wrapPageElementWithLayout
|
2019-11-09 20:09:06 +01:00
|
|
|
|
|
|
|
// 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(
|
2019-11-09 20:26:29 +01:00
|
|
|
'This application has been updated. ' +
|
|
|
|
'Reload to display the latest version?'
|
2019-11-09 20:09:06 +01:00
|
|
|
)
|
|
|
|
if (answer === true) {
|
|
|
|
window.location.reload()
|
|
|
|
}
|
|
|
|
}
|