Compare commits
4 Commits
50faf4da55
...
8f0fd29f3a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f0fd29f3a | ||
| 8601d7ced1 | |||
| 74941a8abc | |||
| 86683d410f |
@ -124,6 +124,19 @@ async fn update_game(
|
|||||||
if let Some(existing) = games.iter_mut().find(|g| {
|
if let Some(existing) = games.iter_mut().find(|g| {
|
||||||
(g.remote_id == game.remote_id && g.source == game.source) || (g.title == game.title)
|
(g.remote_id == game.remote_id && g.source == game.source) || (g.title == game.title)
|
||||||
}) {
|
}) {
|
||||||
|
if existing.title != game.title {
|
||||||
|
// Update title for every opinion
|
||||||
|
for person in user_list.lock().await.iter_mut() {
|
||||||
|
let opinion = person
|
||||||
|
.person
|
||||||
|
.opinion
|
||||||
|
.iter_mut()
|
||||||
|
.find(|o| o.title == existing.title);
|
||||||
|
if let Some(opinion) = opinion {
|
||||||
|
opinion.title = game.title.clone();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
existing.title = game.title.clone();
|
existing.title = game.title.clone();
|
||||||
existing.source = game.source;
|
existing.source = game.source;
|
||||||
existing.min_players = game.min_players;
|
existing.min_players = game.min_players;
|
||||||
@ -133,6 +146,9 @@ async fn update_game(
|
|||||||
|
|
||||||
r_existing = Some(existing.clone());
|
r_existing = Some(existing.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
games.sort_unstable_by(|g1, g2| g1.title.cmp(&g2.title));
|
||||||
|
|
||||||
let users = user_list.lock().await;
|
let users = user_list.lock().await;
|
||||||
save_state(&games, &users);
|
save_state(&games, &users);
|
||||||
|
|
||||||
@ -154,7 +170,12 @@ async fn delete_game(
|
|||||||
{
|
{
|
||||||
let game = games.remove(pos);
|
let game = games.remove(pos);
|
||||||
|
|
||||||
let users = user_list.lock().await;
|
let mut users = user_list.lock().await;
|
||||||
|
|
||||||
|
for person in users.iter_mut() {
|
||||||
|
person.person.opinion.retain_mut(|o| o.title != game.title);
|
||||||
|
}
|
||||||
|
|
||||||
save_state(&games, &users);
|
save_state(&games, &users);
|
||||||
|
|
||||||
return Some(game);
|
return Some(game);
|
||||||
|
|||||||
22
frontend/pnpm-lock.yaml
generated
22
frontend/pnpm-lock.yaml
generated
@ -29,7 +29,7 @@ importers:
|
|||||||
version: 9.39.1
|
version: 9.39.1
|
||||||
'@types/node':
|
'@types/node':
|
||||||
specifier: ^24.10.1
|
specifier: ^24.10.1
|
||||||
version: 24.10.1
|
version: 24.10.7
|
||||||
'@types/react':
|
'@types/react':
|
||||||
specifier: ^19.2.7
|
specifier: ^19.2.7
|
||||||
version: 19.2.7
|
version: 19.2.7
|
||||||
@ -38,7 +38,7 @@ importers:
|
|||||||
version: 19.2.3(@types/react@19.2.7)
|
version: 19.2.3(@types/react@19.2.7)
|
||||||
'@vitejs/plugin-react':
|
'@vitejs/plugin-react':
|
||||||
specifier: ^5.1.2
|
specifier: ^5.1.2
|
||||||
version: 5.1.2(rolldown-vite@7.2.5(@types/node@24.10.1))
|
version: 5.1.2(rolldown-vite@7.2.5(@types/node@24.10.7))
|
||||||
eslint:
|
eslint:
|
||||||
specifier: ^9.39.1
|
specifier: ^9.39.1
|
||||||
version: 9.39.1
|
version: 9.39.1
|
||||||
@ -62,7 +62,7 @@ importers:
|
|||||||
version: 8.48.1(eslint@9.39.1)(typescript@5.9.3)
|
version: 8.48.1(eslint@9.39.1)(typescript@5.9.3)
|
||||||
vite:
|
vite:
|
||||||
specifier: npm:rolldown-vite@7.2.5
|
specifier: npm:rolldown-vite@7.2.5
|
||||||
version: rolldown-vite@7.2.5(@types/node@24.10.1)
|
version: rolldown-vite@7.2.5(@types/node@24.10.7)
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
|
|
||||||
@ -351,8 +351,8 @@ packages:
|
|||||||
'@types/json-schema@7.0.15':
|
'@types/json-schema@7.0.15':
|
||||||
resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==}
|
resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==}
|
||||||
|
|
||||||
'@types/node@24.10.1':
|
'@types/node@24.10.7':
|
||||||
resolution: {integrity: sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==}
|
resolution: {integrity: sha512-+054pVMzVTmRQV8BhpGv3UyfZ2Llgl8rdpDTon+cUH9+na0ncBVXj3wTUKh14+Kiz18ziM3b4ikpP5/Pc0rQEQ==}
|
||||||
|
|
||||||
'@types/react-dom@19.2.3':
|
'@types/react-dom@19.2.3':
|
||||||
resolution: {integrity: sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==}
|
resolution: {integrity: sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==}
|
||||||
@ -425,7 +425,7 @@ packages:
|
|||||||
resolution: {integrity: sha512-EcA07pHJouywpzsoTUqNh5NwGayl2PPVEJKUSinGGSxFGYn+shYbqMGBg6FXDqgXum9Ou/ecb+411ssw8HImJQ==}
|
resolution: {integrity: sha512-EcA07pHJouywpzsoTUqNh5NwGayl2PPVEJKUSinGGSxFGYn+shYbqMGBg6FXDqgXum9Ou/ecb+411ssw8HImJQ==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
vite: ^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0
|
vite: npm:rolldown-vite@7.2.5
|
||||||
|
|
||||||
acorn-jsx@5.3.2:
|
acorn-jsx@5.3.2:
|
||||||
resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
|
resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
|
||||||
@ -1350,7 +1350,7 @@ snapshots:
|
|||||||
|
|
||||||
'@types/json-schema@7.0.15': {}
|
'@types/json-schema@7.0.15': {}
|
||||||
|
|
||||||
'@types/node@24.10.1':
|
'@types/node@24.10.7':
|
||||||
dependencies:
|
dependencies:
|
||||||
undici-types: 7.16.0
|
undici-types: 7.16.0
|
||||||
|
|
||||||
@ -1454,7 +1454,7 @@ snapshots:
|
|||||||
'@typescript-eslint/types': 8.48.1
|
'@typescript-eslint/types': 8.48.1
|
||||||
eslint-visitor-keys: 4.2.1
|
eslint-visitor-keys: 4.2.1
|
||||||
|
|
||||||
'@vitejs/plugin-react@5.1.2(rolldown-vite@7.2.5(@types/node@24.10.1))':
|
'@vitejs/plugin-react@5.1.2(rolldown-vite@7.2.5(@types/node@24.10.7))':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/core': 7.28.5
|
'@babel/core': 7.28.5
|
||||||
'@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/core@7.28.5)
|
'@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/core@7.28.5)
|
||||||
@ -1462,7 +1462,7 @@ snapshots:
|
|||||||
'@rolldown/pluginutils': 1.0.0-beta.53
|
'@rolldown/pluginutils': 1.0.0-beta.53
|
||||||
'@types/babel__core': 7.20.5
|
'@types/babel__core': 7.20.5
|
||||||
react-refresh: 0.18.0
|
react-refresh: 0.18.0
|
||||||
vite: rolldown-vite@7.2.5(@types/node@24.10.1)
|
vite: rolldown-vite@7.2.5(@types/node@24.10.7)
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
@ -1870,7 +1870,7 @@ snapshots:
|
|||||||
|
|
||||||
resolve-from@4.0.0: {}
|
resolve-from@4.0.0: {}
|
||||||
|
|
||||||
rolldown-vite@7.2.5(@types/node@24.10.1):
|
rolldown-vite@7.2.5(@types/node@24.10.7):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@oxc-project/runtime': 0.97.0
|
'@oxc-project/runtime': 0.97.0
|
||||||
fdir: 6.5.0(picomatch@4.0.3)
|
fdir: 6.5.0(picomatch@4.0.3)
|
||||||
@ -1880,7 +1880,7 @@ snapshots:
|
|||||||
rolldown: 1.0.0-beta.50
|
rolldown: 1.0.0-beta.50
|
||||||
tinyglobby: 0.2.15
|
tinyglobby: 0.2.15
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
'@types/node': 24.10.1
|
'@types/node': 24.10.7
|
||||||
fsevents: 2.3.3
|
fsevents: 2.3.3
|
||||||
|
|
||||||
rolldown@1.0.0-beta.50:
|
rolldown@1.0.0-beta.50:
|
||||||
|
|||||||
@ -86,7 +86,7 @@ export function FilteredGamesList({
|
|||||||
fontWeight: 600,
|
fontWeight: 600,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{price === 0 ? "0 (Free)" : price}€
|
{price === 0 ? "0€ (Free)" : `${price}€`}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<GameImage game={game} />
|
<GameImage game={game} />
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user