1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-11-26 19:49:26 +01:00
docs/gatsby-browser.js

21 lines
719 B
JavaScript
Raw Normal View History

// import global branding styles
import './src/styles/global.scss'
2018-11-07 12:24:53 +01:00
// IntersectionObserver polyfill for gatsby-image (Safari, IE)
if (typeof window.IntersectionObserver === 'undefined') {
2020-01-06 15:24:57 +01:00
// eslint-disable-next-line no-unused-expressions
import('intersection-observer')
}
// 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()
}
}