Compare commits

...

4 Commits

3 changed files with 32 additions and 11 deletions

View File

@ -124,6 +124,19 @@ async fn update_game(
if let Some(existing) = games.iter_mut().find(|g| {
(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.source = game.source;
existing.min_players = game.min_players;
@ -133,6 +146,9 @@ async fn update_game(
r_existing = Some(existing.clone());
}
games.sort_unstable_by(|g1, g2| g1.title.cmp(&g2.title));
let users = user_list.lock().await;
save_state(&games, &users);
@ -154,7 +170,12 @@ async fn delete_game(
{
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);
return Some(game);

View File

@ -22,7 +22,7 @@ importers:
version: 19.2.1(react@19.2.1)
react-router-dom:
specifier: ^7.10.1
version: 7.10.1(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
version: 7.12.0(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
devDependencies:
'@eslint/js':
specifier: ^9.39.1
@ -425,7 +425,7 @@ packages:
resolution: {integrity: sha512-EcA07pHJouywpzsoTUqNh5NwGayl2PPVEJKUSinGGSxFGYn+shYbqMGBg6FXDqgXum9Ou/ecb+411ssw8HImJQ==}
engines: {node: ^20.19.0 || >=22.12.0}
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:
resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
@ -872,15 +872,15 @@ packages:
resolution: {integrity: sha512-QgT5//D3jfjJb6Gsjxv0Slpj23ip+HtOpnNgnb2S5zU3CB26G/IDPGoy4RJB42wzFE46DRsstbW6tKHoKbhAxw==}
engines: {node: '>=0.10.0'}
react-router-dom@7.10.1:
resolution: {integrity: sha512-JNBANI6ChGVjA5bwsUIwJk7LHKmqB4JYnYfzFwyp2t12Izva11elds2jx7Yfoup2zssedntwU0oZ5DEmk5Sdaw==}
react-router-dom@7.12.0:
resolution: {integrity: sha512-pfO9fiBcpEfX4Tx+iTYKDtPbrSLLCbwJ5EqP+SPYQu1VYCXdy79GSj0wttR0U4cikVdlImZuEZ/9ZNCgoaxwBA==}
engines: {node: '>=20.0.0'}
peerDependencies:
react: '>=18'
react-dom: '>=18'
react-router@7.10.1:
resolution: {integrity: sha512-gHL89dRa3kwlUYtRQ+m8NmxGI6CgqN+k4XyGjwcFoQwwCWF6xXpOCUlDovkXClS0d0XJN/5q7kc5W3kiFEd0Yw==}
react-router@7.12.0:
resolution: {integrity: sha512-kTPDYPFzDVGIIGNLS5VJykK0HfHLY5MF3b+xj0/tTyNYL1gF1qs7u67Z9jEhQk2sQ98SUaHxlG31g1JtF7IfVw==}
engines: {node: '>=20.0.0'}
peerDependencies:
react: '>=18'
@ -1852,13 +1852,13 @@ snapshots:
react-refresh@0.18.0: {}
react-router-dom@7.10.1(react-dom@19.2.1(react@19.2.1))(react@19.2.1):
react-router-dom@7.12.0(react-dom@19.2.1(react@19.2.1))(react@19.2.1):
dependencies:
react: 19.2.1
react-dom: 19.2.1(react@19.2.1)
react-router: 7.10.1(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
react-router: 7.12.0(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
react-router@7.10.1(react-dom@19.2.1(react@19.2.1))(react@19.2.1):
react-router@7.12.0(react-dom@19.2.1(react@19.2.1))(react@19.2.1):
dependencies:
cookie: 1.1.1
react: 19.2.1

View File

@ -86,7 +86,7 @@ export function FilteredGamesList({
fontWeight: 600,
}}
>
{price === 0 ? "0 (Free)" : price}
{price === 0 ? "0€ (Free)" : `${price}`}
</div>
</div>
<GameImage game={game} />