Skip to content

Commit 1eced8d

Browse files
authored
Merge pull request #138 from CodeDead/feature/remove-analytics
Feature/remove analytics
2 parents 7e513bd + 41e1d4f commit 1eced8d

File tree

27 files changed

+39
-224
lines changed

27 files changed

+39
-224
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Dockerfile
1212
.eslintcache
1313
.eslintrc.json
1414
.prettierignore
15-
eslint.config.js
1615
.idea
1716
.vscode
1817
dist

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
FROM node:current-alpine as build
1+
FROM node:current-alpine AS build
22

33
WORKDIR /app
4-
ENV PATH /app/node_modules/.bin:$PATH
4+
ENV PATH=/app/node_modules/.bin:$PATH
55

66
COPY package.json ./
77

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"graphemer": "^1.4.0",
2121
"react": "^19.1.0",
2222
"react-dom": "^19.1.0",
23-
"react-ga4": "^2.1.0",
2423
"react-router-dom": "^7.5.3"
2524
},
2625
"scripts": {

src-tauri/Cargo.lock

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@ async fn generate_passwords(
7878
}
7979
}
8080

81-
let mut rng = rand::thread_rng();
81+
let mut rng = rand::rng();
8282
let chars = graphemes.collect::<Vec<&str>>();
8383
for _n in 0..amount {
8484
let mut can_continue = false;
8585
while !can_continue {
8686
let mut password = String::from("");
87-
let length = rng.gen_range(min_length..(max_length + 1));
87+
let length = rng.random_range(min_length..(max_length + 1));
8888
for _j in 0..length {
89-
let index = rng.gen_range(0..char_count);
89+
let index = rng.random_range(0..char_count);
9090
password.push_str(chars.clone()[index]);
9191
}
9292

src/components/App/index.jsx

Lines changed: 1 addition & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@ import { createTheme, ThemeProvider } from '@mui/material/styles';
88
import Toolbar from '@mui/material/Toolbar';
99
import Typography from '@mui/material/Typography';
1010
import { platform } from '@tauri-apps/plugin-os';
11-
import ReactGA from 'react-ga4';
1211
import { BrowserRouter, Routes, Route } from 'react-router-dom';
1312
import packageJson from '../../../package.json';
1413
import { MainContext } from '../../contexts/MainContextProvider';
1514
import {
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

src/contexts/MainContextProvider/index.jsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@ const tips = localStorage.tips ? localStorage.tips === 'true' : true;
3030
const sortByStrength = localStorage.sortByStrength
3131
? localStorage.sortByStrength === 'true'
3232
: true;
33-
let hasSetCookies = false;
34-
let allowCookies = true;
35-
36-
if (localStorage.allowCookies) {
37-
allowCookies = localStorage.allowCookies === 'true';
38-
hasSetCookies = true;
39-
}
4033

4134
const initState = {
4235
autoUpdate,
@@ -52,8 +45,6 @@ const initState = {
5245
loading: false,
5346
colorOnDark,
5447
tips,
55-
allowCookies,
56-
hasSetCookies,
5748
sortByStrength,
5849
};
5950

src/languages/de_de.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,5 @@
132132
"includeSymbols": "Symbole einschließen",
133133
"useEmojis": "Emojis verwenden",
134134
"exportSuccessful": "Export erfolgreich",
135-
"cookieNoticeText": "Diese Website verwendet Cookies, um sicherzustellen, dass Sie die bestmögliche Erfahrung auf unserer Website haben.",
136-
"accept": "Akzeptieren",
137-
"reject": "Ablehnen",
138135
"sortByStrength": "Standardmäßig nach Stärke sortieren"
139136
}

src/languages/en_us.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,5 @@
134134
"includeSymbols": "Include symbols",
135135
"useEmojis": "Use emojis",
136136
"exportSuccessful": "Export successful",
137-
"cookieNoticeText": "This website uses cookies to ensure you get the best experience on our website.",
138-
"accept": "Accept",
139-
"reject": "Reject",
140137
"sortByStrength": "Sort by strength by default"
141138
}

src/languages/es_es.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,5 @@
134134
"includeSymbols": "Incluir símbolos",
135135
"useEmojis": "Usar emojis",
136136
"exportSuccessful": "Exportación exitosa",
137-
"cookieNoticeText": "Este sitio web utiliza cookies para garantizar que obtenga la mejor experiencia en nuestro sitio web.",
138-
"accept": "Aceptar",
139-
"reject": "Rechazar",
140137
"sortByStrength": "Ordenar por fuerza de forma predeterminada"
141138
}

0 commit comments

Comments
 (0)