Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Dockerfile
.eslintcache
.eslintrc.json
.prettierignore
eslint.config.js
.idea
.vscode
dist
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM node:current-alpine as build
FROM node:current-alpine AS build

WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
ENV PATH=/app/node_modules/.bin:$PATH

COPY package.json ./

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
22 changes: 11 additions & 11 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ async fn generate_passwords(
}
}

let mut rng = rand::thread_rng();
let mut rng = rand::rng();
let chars = graphemes.collect::<Vec<&str>>();
for _n in 0..amount {
let mut can_continue = false;
while !can_continue {
let mut password = String::from("");
let length = rng.gen_range(min_length..(max_length + 1));
let length = rng.random_range(min_length..(max_length + 1));
for _j in 0..length {
let index = rng.gen_range(0..char_count);
let index = rng.random_range(0..char_count);
password.push_str(chars.clone()[index]);
}

Expand Down
65 changes: 1 addition & 64 deletions src/components/App/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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
*/
Expand All @@ -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 (
<ThemeProvider theme={theme}>
<BrowserRouter>
Expand Down Expand Up @@ -221,31 +182,7 @@ const App = () => {
agreeLabel={language.ok}
/>
) : null}
{}
{!window.__TAURI__ && cookieBannerOpen ? (
<Alert
onClose={closeCookieSnack}
severity="info"
sx={{
width: '100%',
position: 'fixed',
bottom: 0,
}}
>
<Typography>{language.cookieNoticeText}</Typography>
<Button onClick={declineCookies} size="small" color="error">
{language.reject}
</Button>
<Button onClick={acceptCookies} size="small" color="primary">
{language.accept}
</Button>
</Alert>
) : null}
<Snackbar
open={snackOpen}
onClose={closeSnack}
sx={{ mb: cookieBannerOpen ? 10 : null }}
>
<Snackbar open={snackOpen} onClose={closeSnack}>
<Alert onClose={closeSnack} severity="info" sx={{ width: '100%' }}>
<Typography>{language.downloadApp}</Typography>
<Button
Expand Down
9 changes: 0 additions & 9 deletions src/contexts/MainContextProvider/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@ const tips = localStorage.tips ? localStorage.tips === 'true' : true;
const sortByStrength = localStorage.sortByStrength
? localStorage.sortByStrength === 'true'
: true;
let hasSetCookies = false;
let allowCookies = true;

if (localStorage.allowCookies) {
allowCookies = localStorage.allowCookies === 'true';
hasSetCookies = true;
}

const initState = {
autoUpdate,
Expand All @@ -52,8 +45,6 @@ const initState = {
loading: false,
colorOnDark,
tips,
allowCookies,
hasSetCookies,
sortByStrength,
};

Expand Down
3 changes: 0 additions & 3 deletions src/languages/de_de.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,5 @@
"includeSymbols": "Symbole einschließen",
"useEmojis": "Emojis verwenden",
"exportSuccessful": "Export erfolgreich",
"cookieNoticeText": "Diese Website verwendet Cookies, um sicherzustellen, dass Sie die bestmögliche Erfahrung auf unserer Website haben.",
"accept": "Akzeptieren",
"reject": "Ablehnen",
"sortByStrength": "Standardmäßig nach Stärke sortieren"
}
3 changes: 0 additions & 3 deletions src/languages/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,5 @@
"includeSymbols": "Include symbols",
"useEmojis": "Use emojis",
"exportSuccessful": "Export successful",
"cookieNoticeText": "This website uses cookies to ensure you get the best experience on our website.",
"accept": "Accept",
"reject": "Reject",
"sortByStrength": "Sort by strength by default"
}
3 changes: 0 additions & 3 deletions src/languages/es_es.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,5 @@
"includeSymbols": "Incluir símbolos",
"useEmojis": "Usar emojis",
"exportSuccessful": "Exportación exitosa",
"cookieNoticeText": "Este sitio web utiliza cookies para garantizar que obtenga la mejor experiencia en nuestro sitio web.",
"accept": "Aceptar",
"reject": "Rechazar",
"sortByStrength": "Ordenar por fuerza de forma predeterminada"
}
3 changes: 0 additions & 3 deletions src/languages/fr_fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,5 @@
"includeSymbols": "Inclure les symboles",
"useEmojis": "Utiliser les emojis",
"exportSuccessful": "Exportation réussie",
"cookieNoticeText": "Ce site utilise des cookies pour vous garantir la meilleure expérience sur notre site.",
"accept": "Accepter",
"reject": "Rejeter",
"sortByStrength": "Trier par force par défaut"
}
3 changes: 0 additions & 3 deletions src/languages/jp_jp.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,5 @@
"includeSymbols": "シンボルを含める",
"useEmojis": "絵文字を使用する",
"exportSuccessful": "エクスポートに成功しました",
"cookieNoticeText": "このサイトはクッキーを使用しています。 クッキーを使用することに同意する場合は、この通知を閉じてください。",
"accept": "受け入れる",
"reject": "拒否する",
"sortByStrength": "デフォルトで強さ順に並べ替え"
}
3 changes: 0 additions & 3 deletions src/languages/nl_nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,5 @@
"includeSymbols": "Inclusief symbolen",
"useEmojis": "Gebruik emoji's",
"exportSuccessful": "Export aangemaakt",
"cookieNoticeText": "Deze website maakt gebruik van cookies om ervoor te zorgen dat je de beste ervaring op onze website krijgt.",
"accept": "Accepteren",
"reject": "Afwijzen",
"sortByStrength": "Standaard sorteren op sterkte"
}
3 changes: 0 additions & 3 deletions src/languages/ru_ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,5 @@
"includeSymbols": "Включить символы",
"useEmojis": "Использовать эмодзи",
"exportSuccessful": "Экспорт успешно завершен!",
"cookieNoticeText": "Этот сайт использует файлы cookie, чтобы обеспечить вам лучший опыт на нашем сайте.",
"accept": "Принять",
"reject": "Отклонить",
"sortByStrength": "Сортировать по силе по умолчанию"
}
3 changes: 0 additions & 3 deletions src/languages/tr_tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,5 @@
"includeSymbols": "Semboller dahil",
"useEmojis": "Emojileri kullan",
"exportSuccessful": "Başarıyla dışa aktarıldı",
"cookieNoticeText": "Bu site, size sitemizde en iyi deneyimi sunmak için çerezler kullanır. Çerez kullanımını kabul ediyorsanız, bu bildirimi kapatın.",
"accept": "Kabul etmek",
"reject": "Reddetmek",
"sortByStrength": "Varsayılan olarak güce göre sırala"
}
3 changes: 0 additions & 3 deletions src/languages/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,5 @@
"includeSymbols": "包含符号",
"useEmojis": "使用表情符号",
"exportSuccessful": "导出成功",
"cookieNoticeText": "本网站使用 Cookie。如果您同意使用 Cookie,请关闭此通知。",
"accept": "接受",
"reject": "拒绝",
"sortByStrength": "默认按强度排序"
}
1 change: 0 additions & 1 deletion src/reducers/MainReducer/Actions/actionTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ export const SET_LOADING = 'SET_LOADING';
export const SET_CHECKED_FOR_UPDATES = 'SET_CHECKED_FOR_UPDATES';
export const SET_COLOR_ON_DARK = 'SET_COLOR_ON_DARK';
export const SET_TIPS = 'SET_TIPS';
export const SET_ALLOW_COOKIES = 'SET_ALLOW_COOKIES';
export const SET_DEFAULT_SORT_BY_STRENGTH = 'SET_DEFAULT_SORT_BY_STRENGTH';
6 changes: 0 additions & 6 deletions src/reducers/MainReducer/Actions/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { invoke } from '@tauri-apps/api/core';
import {
RESET_STATE,
SET_ALLOW_COOKIES,
SET_AUTO_UPDATE,
SET_CHECKED_FOR_UPDATES,
SET_COLOR_ON_DARK,
Expand Down Expand Up @@ -91,11 +90,6 @@ export const setTips = (value) => ({
payload: value,
});

export const setAllowCookies = (allow) => ({
type: SET_ALLOW_COOKIES,
payload: allow,
});

export const setDefaultSortByStrength = (value) => ({
type: SET_DEFAULT_SORT_BY_STRENGTH,
payload: value,
Expand Down
7 changes: 0 additions & 7 deletions src/reducers/MainReducer/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
RESET_STATE,
SET_ALLOW_COOKIES,
SET_AUTO_UPDATE,
SET_CHECKED_FOR_UPDATES,
SET_COLOR_ON_DARK,
Expand Down Expand Up @@ -101,12 +100,6 @@ const MainReducer = (state, action) => {
...state,
tips: action.payload,
};
case SET_ALLOW_COOKIES:
localStorage.allowCookies = action.payload;
return {
...state,
allowCookies: action.payload,
};
case SET_DEFAULT_SORT_BY_STRENGTH:
localStorage.sortByStrength = action.payload;
return {
Expand Down
Loading