@@ -3,6 +3,7 @@ import { render, hydrate } from 'react-dom';
3
3
import { fetchSlides } from '../utils/fetchSlides' ;
4
4
import { setTargetBlank } from '../utils/targetBlank' ;
5
5
import { AppContainer } from '../components/AppContainer' ;
6
+ import { getSearchParams } from '../utils/getSearchParams' ;
6
7
import '../setup/css' ;
7
8
8
9
function createBody ( slides = [ ] , hash = 0 ) {
@@ -25,18 +26,22 @@ if (process.env.TARGET_BLANK) {
25
26
}
26
27
27
28
if ( process . env . NODE_ENV !== 'production' ) {
28
- ( async ( ) => {
29
- // for tree shaking
30
- const { Assistant } = await import ( '../components/Assistant' ) ;
31
- const el = document . createElement ( 'div' ) ;
32
-
33
- el . style . position = 'absolute' ;
34
- el . style . top = 0 ;
35
- el . style . width = '100%' ;
36
- el . style . zIndex = 10000 ;
37
- el . setAttribute ( 'id' , 'reference' ) ;
38
- document . body . appendChild ( el ) ;
39
-
40
- render ( < Assistant /> , document . getElementById ( 'reference' ) ) ;
41
- } ) ( ) ;
29
+ const params = getSearchParams ( ) ;
30
+
31
+ if ( params . get ( 'reference' ) !== 'false' ) {
32
+ ( async ( ) => {
33
+ // for tree shaking
34
+ const { Assistant } = await import ( '../components/Assistant' ) ;
35
+ const el = document . createElement ( 'div' ) ;
36
+
37
+ el . style . position = 'absolute' ;
38
+ el . style . top = 0 ;
39
+ el . style . width = '100%' ;
40
+ el . style . zIndex = 10000 ;
41
+ el . setAttribute ( 'id' , 'reference' ) ;
42
+ document . body . appendChild ( el ) ;
43
+
44
+ render ( < Assistant /> , document . getElementById ( 'reference' ) ) ;
45
+ } ) ( ) ;
46
+ }
42
47
}
0 commit comments