1- import React , { useEffect } from 'react' ;
2- import ReactGA from 'react-ga' ;
1+ import React from 'react' ;
32import { hot } from 'react-hot-loader/root' ;
4- import { Route , Router , Switch , useLocation } from 'react-router-dom' ;
3+ import { Route , Router , Switch } from 'react-router-dom' ;
54import { StoreProvider } from 'easy-peasy' ;
65import { store } from '@/state' ;
76import DashboardRouter from '@/routers/DashboardRouter' ;
@@ -33,16 +32,6 @@ interface ExtendedWindow extends Window {
3332
3433setupInterceptors ( history ) ;
3534
36- const Pageview = ( ) => {
37- const { pathname } = useLocation ( ) ;
38-
39- useEffect ( ( ) => {
40- ReactGA . pageview ( pathname ) ;
41- } , [ pathname ] ) ;
42-
43- return null ;
44- } ;
45-
4635const App = ( ) => {
4736 const { PterodactylUser, SiteConfiguration } = ( window as ExtendedWindow ) ;
4837 if ( PterodactylUser && ! store . getState ( ) . user . data ) {
@@ -62,12 +51,6 @@ const App = () => {
6251 store . getActions ( ) . settings . setSettings ( SiteConfiguration ! ) ;
6352 }
6453
65- useEffect ( ( ) => {
66- if ( SiteConfiguration ?. analytics ) {
67- ReactGA . initialize ( SiteConfiguration ! . analytics ) ;
68- }
69- } , [ ] ) ;
70-
7154 return (
7255 < >
7356 < GlobalStylesheet />
@@ -76,7 +59,6 @@ const App = () => {
7659 < ProgressBar />
7760 < div css = { tw `mx-auto w-auto` } >
7861 < Router history = { history } >
79- { SiteConfiguration ?. analytics && < Pageview /> }
8062 < Switch >
8163 < Route path = "/server/:id" component = { ServerRouter } />
8264 < Route path = "/auth" component = { AuthenticationRouter } />
0 commit comments