-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-browser.js
32 lines (28 loc) · 947 Bytes
/
gatsby-browser.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
* Implement Gatsby's Browser APIs in this file.
*
* See: https://www.gatsbyjs.org/docs/browser-apis/
*/
// You can delete this file if you're not using it
// Global Styles
import "bootstrap-css-only/css/bootstrap.min.css"
import "./src/styles/scss/mdb.scss"
import "./src/styles/icons/fontawesome-free/css/all.min.css"
// Displays 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()
}
}
// Adds support for the Gatsby Image Background plugin
export const onClientEntry = () => {
// IntersectionObserver polyfill for gatsby-background-image (Safari, IE)
if (typeof window.IntersectionObserver === `undefined`) {
import(`intersection-observer`)
console.log(`# IntersectionObserver is polyfilled!`)
}
}