1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2024-06-28 00:27:40 +02:00
portfolio/gatsby-browser.js

25 lines
796 B
JavaScript
Raw Normal View History

2019-04-28 22:30:20 +02:00
import wrapPageElementWithLayout from './src/helpers/wrapPageElement'
// Global styles
2020-03-07 03:11:52 +01:00
import './src/styles/global.css'
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
// 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?'
)
if (answer === true) {
window.location.reload()
}
}