File tree 3 files changed +29
-29
lines changed
3 files changed +29
-29
lines changed Original file line number Diff line number Diff line change @@ -25,34 +25,34 @@ export const Analyze = () => {
25
25
return (
26
26
< script
27
27
dangerouslySetInnerHTML = { {
28
- __html :
29
- `${ function run ( ) {
30
- document . addEventListener (
31
- 'click' ,
32
- async ( e ) => {
33
- const $ = e . target as HTMLElement
34
- const event = $ . dataset . event
35
-
36
- if ( event ) {
37
- window . umami ?. track ( event , {
38
- type : 'click' ,
39
- } )
40
- }
41
- } ,
42
- true ,
43
- )
44
-
45
- document . addEventListener ( 'impression' , async ( e : any ) => {
46
- const detail = e . detail as {
47
- action : TrackerAction
48
- label : string
28
+ __html : `(${ function ( ) {
29
+ document . addEventListener (
30
+ 'click' ,
31
+ async ( e ) => {
32
+ const $ = e . target as HTMLElement
33
+ const event = $ . dataset . event
34
+
35
+ if ( event ) {
36
+ window . umami ?. track ( event , {
37
+ type : 'click' ,
38
+ } )
49
39
}
50
-
51
- window . umami ?. track ( detail . label , {
52
- type : 'impression' ,
53
- } )
40
+ } ,
41
+ true ,
42
+ )
43
+
44
+ document . addEventListener ( 'impression' , async ( e : any ) => {
45
+ const detail = e . detail as {
46
+ action : TrackerAction
47
+ label : string
48
+ }
49
+
50
+ console . log ( detail , 'detail' )
51
+ window . umami ?. track ( detail . label , {
52
+ type : 'impression' ,
54
53
} )
55
- } . toString ( ) } \n` + `run();` ,
54
+ } )
55
+ } . toString ( ) } )();`,
56
56
} }
57
57
/>
58
58
)
Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ const SayHi = () => {
149
149
< script
150
150
dangerouslySetInnerHTML = { {
151
151
__html : `var version = "${ version } ";
152
- ${ function info ( ) {
152
+ ( ${ function ( ) {
153
153
console . log (
154
154
`%c Mix Space %c https://github.com/mx-space ` ,
155
155
'color: #fff; margin: 1em 0; padding: 5px 0; background: #2980b9;' ,
@@ -171,7 +171,7 @@ Stay hungry. Stay foolish. --Steve Jobs
171
171
if ( document . firstChild ?. nodeType !== Node . COMMENT_NODE ) {
172
172
document . prepend ( document . createComment ( motto ) )
173
173
}
174
- } . toString ( ) } ; info() `,
174
+ } . toString ( ) } )(); `,
175
175
} }
176
176
/>
177
177
)
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ const XLogSummary: FC<{
67
67
Inner = null
68
68
}
69
69
70
- if ( ! cid || ! data . data ) {
70
+ if ( ! cid || ! data ? .data ) {
71
71
Inner = null
72
72
}
73
73
You can’t perform that action at this time.
0 commit comments