From 9fbc431315272c83422c383d1757fb955db33d4f Mon Sep 17 00:00:00 2001 From: CodeDead Date: Fri, 2 May 2025 19:42:29 +0200 Subject: [PATCH 1/4] feat: removed google analytics, refactoring, dependency upgrades --- package.json | 1 - src-tauri/Cargo.lock | 22 +++---- src/components/App/index.jsx | 65 +------------------ src/contexts/MainContextProvider/index.jsx | 9 --- src/languages/de_de.json | 3 - src/languages/en_us.json | 3 - src/languages/es_es.json | 3 - src/languages/fr_fr.json | 3 - src/languages/jp_jp.json | 3 - src/languages/nl_nl.json | 3 - src/languages/ru_ru.json | 3 - src/languages/tr_tr.json | 3 - src/languages/zh_cn.json | 3 - .../MainReducer/Actions/actionTypes.js | 1 - src/reducers/MainReducer/Actions/index.js | 6 -- src/reducers/MainReducer/index.js | 7 -- src/routes/About/index.jsx | 12 +--- src/routes/Advisor/index.jsx | 12 +--- src/routes/Generate/index.jsx | 10 +-- src/routes/Home/index.jsx | 10 +-- src/routes/NotFound/index.jsx | 11 +--- src/routes/Settings/index.jsx | 9 --- src/routes/Vault/index.jsx | 12 +--- yarn.lock | 38 +++++------ 24 files changed, 34 insertions(+), 218 deletions(-) diff --git a/package.json b/package.json index fbaeed8..fbb90a2 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ "graphemer": "^1.4.0", "react": "^19.1.0", "react-dom": "^19.1.0", - "react-ga4": "^2.1.0", "react-router-dom": "^7.5.3" }, "scripts": { diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 106a15c..38ffc98 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -372,9 +372,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.20" +version = "1.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04da6a0d40b948dfc4fa8f5bbf402b0fc1a64a28dbf7d12ffd683550f2c1b63a" +checksum = "8691782945451c1c383942c4874dbe63814f61cb57ef773cda2972682b7bb3c0" dependencies = [ "shlex", ] @@ -754,9 +754,9 @@ checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] name = "dpi" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f25c0e292a7ca6d6498557ff1df68f32c99850012b6ea401cf8daf771f22ff53" +checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76" dependencies = [ "serde", ] @@ -4120,7 +4120,7 @@ dependencies = [ "serde_spanned", "toml_datetime", "toml_write", - "winnow 0.7.8", + "winnow 0.7.9", ] [[package]] @@ -5143,9 +5143,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e27d6ad3dac991091e4d35de9ba2d2d00647c5d0fc26c5496dee55984ae111b" +checksum = "d9fb597c990f03753e08d3c29efbfcf2019a003b4bf4ba19225c158e1549f0f3" dependencies = [ "memchr", ] @@ -5339,7 +5339,7 @@ dependencies = [ "tracing", "uds_windows", "windows-sys 0.59.0", - "winnow 0.7.8", + "winnow 0.7.9", "xdg-home", "zbus_macros", "zbus_names", @@ -5369,7 +5369,7 @@ checksum = "7be68e64bf6ce8db94f63e72f0c7eb9a60d733f7e0499e628dfab0f84d6bcb97" dependencies = [ "serde", "static_assertions", - "winnow 0.7.8", + "winnow 0.7.9", "zvariant", ] @@ -5447,7 +5447,7 @@ dependencies = [ "serde", "static_assertions", "url", - "winnow 0.7.8", + "winnow 0.7.9", "zvariant_derive", "zvariant_utils", ] @@ -5476,5 +5476,5 @@ dependencies = [ "serde", "static_assertions", "syn 2.0.101", - "winnow 0.7.8", + "winnow 0.7.9", ] diff --git a/src/components/App/index.jsx b/src/components/App/index.jsx index 0f1dd32..adddb3a 100644 --- a/src/components/App/index.jsx +++ b/src/components/App/index.jsx @@ -8,13 +8,11 @@ import { createTheme, ThemeProvider } from '@mui/material/styles'; import Toolbar from '@mui/material/Toolbar'; import Typography from '@mui/material/Typography'; import { platform } from '@tauri-apps/plugin-os'; -import ReactGA from 'react-ga4'; import { BrowserRouter, Routes, Route } from 'react-router-dom'; import packageJson from '../../../package.json'; import { MainContext } from '../../contexts/MainContextProvider'; import { openWebSite, - setAllowCookies, setCheckedForUpdates, setError, setLoading, @@ -47,11 +45,8 @@ const App = () => { error, loading, checkedForUpdates, - allowCookies, - hasSetCookies, } = state; - const [cookieBannerOpen, setCookieBannerOpen] = useState(!hasSetCookies); const [drawerOpen, setDrawerOpen] = useState(false); const [snackOpen, setSnackOpen] = useState(false); const language = state.languages[languageIndex]; @@ -105,29 +100,6 @@ const App = () => { setSnackOpen(false); }; - /** - * Close the cookie snack bar - */ - const closeCookieSnack = () => { - setCookieBannerOpen(false); - }; - - /** - * Accept cookies - */ - const acceptCookies = () => { - d1(setAllowCookies(true)); - setCookieBannerOpen(false); - }; - - /** - * Decline cookies - */ - const declineCookies = () => { - d1(setAllowCookies(false)); - setCookieBannerOpen(false); - }; - /** * Close the dialog that displays a message that no updates are available */ @@ -146,17 +118,6 @@ const App = () => { // eslint-disable-next-line react-hooks/exhaustive-deps }, []); - useEffect(() => { - if (!window.__TAURI__) { - if (allowCookies) { - ReactGA.initialize('G-M3DEBWW06X'); - window['ga-disable-G-M3DEBWW06X'] = false; - } else { - window['ga-disable-G-M3DEBWW06X'] = true; - } - } - }, [allowCookies]); - return ( @@ -221,31 +182,7 @@ const App = () => { agreeLabel={language.ok} /> ) : null} - {} - {!window.__TAURI__ && cookieBannerOpen ? ( - - {language.cookieNoticeText} - - - - ) : null} - + {language.downloadApp}