forked from inkeep/inkeep-milvus.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-browser.js
33 lines (27 loc) · 928 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
33
import './src/css/variables.css';
import './src/css/reset.css';
import './src/css/global.css';
import './src/css/grid.less';
import '@fontsource/inter/400.css';
import '@fontsource/inter/500.css';
import '@fontsource/inter/600.css';
import '@fontsource/inter/700.css';
import '@fontsource/source-code-pro/400.css';
import '@fontsource/source-code-pro/500.css';
import '@fontsource/source-code-pro/600.css';
import '@fontsource/source-code-pro/700.css';
import '@fontsource/roboto-mono/400.css';
import '@fontsource/roboto-mono/500.css';
import '@fontsource/roboto-mono/600.css';
import '@fontsource/roboto-mono/700.css';
let nextRoute = '';
export const onPreRouteUpdate = ({ location }) => {
nextRoute = location.pathname;
};
window.addEventListener('unhandledrejection', event => {
if (/loading chunk \d* failed./i.test(event.reason)) {
if (nextRoute) {
window.location.pathname = nextRoute;
}
}
});