mirror of
https://github.com/kremalicious/blog.git
synced 2024-12-22 17:23:50 +01:00
16 lines
697 B
JavaScript
16 lines
697 B
JavaScript
import './src/global/global.css'
|
|
import './src/global/imports.css'
|
|
|
|
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 div = document.createElement('div')
|
|
div.id = 'toast'
|
|
div.classList.add('alert', 'alert-info')
|
|
div.innerHTML = `<button onClick="window.location.reload()">This application has been updated. <span>Click to Reload</span>.</button>`
|
|
document.body.append(div)
|
|
}
|