This repository was archived by the owner on Nov 8, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ import dynamic from 'next/dynamic'
99
1010import { connectStore , buildLog } from '@utils'
1111
12+ import { useScript } from '@components/Hooks'
13+
1214import NumDashboard from './NumDashboard'
1315import MapLoading from './MapLoading'
1416
@@ -26,6 +28,11 @@ const GeoMapSSR = dynamic({
2628} )
2729
2830const UsersThreadContainer = ( { usersThread } ) => {
31+ /* load g2 from CDN, it's too big for dynamic import, and i am poor ..' */
32+ const [ g2ScriptLoaded ] = useScript (
33+ 'https://a.alipayobjects.com/g/datavis/g2/2.3.13/index.js'
34+ )
35+
2936 useInit ( usersThread )
3037
3138 const {
@@ -36,7 +43,7 @@ const UsersThreadContainer = ({ usersThread }) => {
3643 showNums,
3744 } = usersThread
3845
39- const ready = GeoMapSSR !== null && ! geoDataLoading
46+ const ready = g2ScriptLoaded && GeoMapSSR !== null && ! geoDataLoading
4047
4148 return (
4249 < Wrapper >
Original file line number Diff line number Diff line change @@ -48,12 +48,6 @@ export default class DocumentPage extends Document {
4848 content = "width=device-width, initial-scale=1, viewport-fit=cover"
4949 />
5050
51- { /* load g2 from CDN, it's too big for dynamic import, and i am poor ..' */ }
52- < script
53- async
54- src = "https://a.alipayobjects.com/g/datavis/g2/2.3.13/index.js"
55- />
56- { /* https://cps-oss.oss-cn-shanghai.aliyuncs.com/antd-3.8.4-mini.css */ }
5751 < link href = "/antd-3.8.4-mini.css" rel = "stylesheet" />
5852 < link
5953 href = "https://fonts.googleapis.com/css?family=Orbitron"
@@ -63,9 +57,7 @@ export default class DocumentPage extends Document {
6357
6458 < script
6559 async
66- src = { `https://www.googletagmanager.com/gtag/js?id=${
67- process . env . GA_TRACING_ID
68- } `}
60+ src = { `https://www.googletagmanager.com/gtag/js?id=${ process . env . GA_TRACING_ID } ` }
6961 />
7062 < script
7163 dangerouslySetInnerHTML = { {
You can’t perform that action at this time.
0 commit comments