@@ -8,13 +8,11 @@ import { createTheme, ThemeProvider } from '@mui/material/styles';
88import Toolbar from '@mui/material/Toolbar' ;
99import Typography from '@mui/material/Typography' ;
1010import { platform } from '@tauri-apps/plugin-os' ;
11- import ReactGA from 'react-ga4' ;
1211import { BrowserRouter , Routes , Route } from 'react-router-dom' ;
1312import packageJson from '../../../package.json' ;
1413import { MainContext } from '../../contexts/MainContextProvider' ;
1514import {
1615 openWebSite ,
17- setAllowCookies ,
1816 setCheckedForUpdates ,
1917 setError ,
2018 setLoading ,
@@ -47,11 +45,8 @@ const App = () => {
4745 error,
4846 loading,
4947 checkedForUpdates,
50- allowCookies,
51- hasSetCookies,
5248 } = state ;
5349
54- const [ cookieBannerOpen , setCookieBannerOpen ] = useState ( ! hasSetCookies ) ;
5550 const [ drawerOpen , setDrawerOpen ] = useState ( false ) ;
5651 const [ snackOpen , setSnackOpen ] = useState ( false ) ;
5752 const language = state . languages [ languageIndex ] ;
@@ -105,29 +100,6 @@ const App = () => {
105100 setSnackOpen ( false ) ;
106101 } ;
107102
108- /**
109- * Close the cookie snack bar
110- */
111- const closeCookieSnack = ( ) => {
112- setCookieBannerOpen ( false ) ;
113- } ;
114-
115- /**
116- * Accept cookies
117- */
118- const acceptCookies = ( ) => {
119- d1 ( setAllowCookies ( true ) ) ;
120- setCookieBannerOpen ( false ) ;
121- } ;
122-
123- /**
124- * Decline cookies
125- */
126- const declineCookies = ( ) => {
127- d1 ( setAllowCookies ( false ) ) ;
128- setCookieBannerOpen ( false ) ;
129- } ;
130-
131103 /**
132104 * Close the dialog that displays a message that no updates are available
133105 */
@@ -146,17 +118,6 @@ const App = () => {
146118 // eslint-disable-next-line react-hooks/exhaustive-deps
147119 } , [ ] ) ;
148120
149- useEffect ( ( ) => {
150- if ( ! window . __TAURI__ ) {
151- if ( allowCookies ) {
152- ReactGA . initialize ( 'G-M3DEBWW06X' ) ;
153- window [ 'ga-disable-G-M3DEBWW06X' ] = false ;
154- } else {
155- window [ 'ga-disable-G-M3DEBWW06X' ] = true ;
156- }
157- }
158- } , [ allowCookies ] ) ;
159-
160121 return (
161122 < ThemeProvider theme = { theme } >
162123 < BrowserRouter >
@@ -221,31 +182,7 @@ const App = () => {
221182 agreeLabel = { language . ok }
222183 />
223184 ) : null }
224- { }
225- { ! window . __TAURI__ && cookieBannerOpen ? (
226- < Alert
227- onClose = { closeCookieSnack }
228- severity = "info"
229- sx = { {
230- width : '100%' ,
231- position : 'fixed' ,
232- bottom : 0 ,
233- } }
234- >
235- < Typography > { language . cookieNoticeText } </ Typography >
236- < Button onClick = { declineCookies } size = "small" color = "error" >
237- { language . reject }
238- </ Button >
239- < Button onClick = { acceptCookies } size = "small" color = "primary" >
240- { language . accept }
241- </ Button >
242- </ Alert >
243- ) : null }
244- < Snackbar
245- open = { snackOpen }
246- onClose = { closeSnack }
247- sx = { { mb : cookieBannerOpen ? 10 : null } }
248- >
185+ < Snackbar open = { snackOpen } onClose = { closeSnack } >
249186 < Alert onClose = { closeSnack } severity = "info" sx = { { width : '100%' } } >
250187 < Typography > { language . downloadApp } </ Typography >
251188 < Button
0 commit comments