ref: remove google analytics (#3912)

This commit is contained in:
Alex 2022-02-05 19:08:43 +02:00 committed by GitHub
parent 0ff60d83eb
commit 5120590e47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 33 additions and 38 deletions

View file

@ -1,7 +1,6 @@
import React, { useEffect } from 'react';
import ReactGA from 'react-ga';
import React from 'react';
import { hot } from 'react-hot-loader/root';
import { Route, Router, Switch, useLocation } from 'react-router-dom';
import { Route, Router, Switch } from 'react-router-dom';
import { StoreProvider } from 'easy-peasy';
import { store } from '@/state';
import DashboardRouter from '@/routers/DashboardRouter';
@ -33,16 +32,6 @@ interface ExtendedWindow extends Window {
setupInterceptors(history);
const Pageview = () => {
const { pathname } = useLocation();
useEffect(() => {
ReactGA.pageview(pathname);
}, [ pathname ]);
return null;
};
const App = () => {
const { PterodactylUser, SiteConfiguration } = (window as ExtendedWindow);
if (PterodactylUser && !store.getState().user.data) {
@ -62,12 +51,6 @@ const App = () => {
store.getActions().settings.setSettings(SiteConfiguration!);
}
useEffect(() => {
if (SiteConfiguration?.analytics) {
ReactGA.initialize(SiteConfiguration!.analytics);
}
}, []);
return (
<>
<GlobalStylesheet/>
@ -76,7 +59,6 @@ const App = () => {
<ProgressBar/>
<div css={tw`mx-auto w-auto`}>
<Router history={history}>
{SiteConfiguration?.analytics && <Pageview/>}
<Switch>
<Route path="/server/:id" component={ServerRouter}/>
<Route path="/auth" component={AuthenticationRouter}/>