File tree 1 file changed +11
-11
lines changed
1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -13,17 +13,17 @@ function App({ Component, pageProps }: AppProps): ReactElement {
13
13
const initAnalytics = useStore ( ( state ) => state . initAnalytics ) ;
14
14
15
15
useEffect ( ( ) => {
16
- initAnalytics ( ) ;
17
- } , [ initAnalytics ] ) ;
18
-
19
- if ( analytics ) {
20
- Router . events . on ( "routeChangeComplete " , ( url ) =>
21
- analytics . logEvent ( `routeChangeComplete : ${ url } ` )
22
- ) ;
23
- Router . events . on ( "hashChangeComplete" , ( url ) =>
24
- analytics . logEvent ( `hashChangeComplete: ${ url } ` )
25
- ) ;
26
- }
16
+ if ( analytics ) {
17
+ Router . events . on ( "routeChangeComplete" , ( url ) => {
18
+ analytics . logEvent ( `routeChangeComplete: ${ url } ` ) ;
19
+ } ) ;
20
+ Router . events . on ( "hashChangeComplete " , ( url ) =>
21
+ analytics . logEvent ( `hashChangeComplete : ${ url } ` )
22
+ ) ;
23
+ } else {
24
+ initAnalytics ( ) ;
25
+ }
26
+ } , [ analytics , initAnalytics ] ) ;
27
27
28
28
return (
29
29
< >
You can’t perform that action at this time.
0 commit comments