-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgatsby-browser.js
49 lines (44 loc) · 1.31 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
* Implement Gatsby's Browser APIs in this file.
*
* See: https://www.gatsbyjs.com/docs/browser-apis/
*/
// You can delete this file if you're not using it
import { toast } from 'react-toastify'
export const onServiceWorkerInstalled = () => {
toast.success(
'Langua has been successfully cached. You can now use it offline.',
{
autoClose: 5000,
className: 'toast-cached',
bodyClassName: 'toast-cached-body',
progressClassName: 'toast-cached-progress'
}
)
// eslint-disable-next-line
console.log(
'Langua has been successfully cached. You can now use it offline.'
)
}
/* Hide this notice
export const onServiceWorkerActive = () => {
toast.info('Langua is up-to-date and loading from your cache.', {
autoClose: 3000,
className: 'toast-cached',
bodyClassName: 'toast-cached-body',
progressClassName: 'toast-cached-progress'
})
// eslint-disable-next-line
console.log(
'This web app is being served cache-first by a service worker. To learn more, visit https://goo.gl/SC7cgQ'
)
}
*/
export const onServiceWorkerUpdateReady = () => {
toast.warn('An update is available; please refresh the page to load it.', {
autoClose: false,
className: 'toast-update',
bodyClassName: 'toast-update-body',
progressClassName: 'toast-update-progress'
})
}