Compare commits
1 Commits
1e7f1645a6
...
ee39e28443
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee39e28443 |
@ -124,19 +124,6 @@ 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;
|
||||||
@ -146,9 +133,6 @@ 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);
|
||||||
|
|
||||||
@ -170,12 +154,7 @@ async fn delete_game(
|
|||||||
{
|
{
|
||||||
let game = games.remove(pos);
|
let game = games.remove(pos);
|
||||||
|
|
||||||
let mut users = user_list.lock().await;
|
let 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);
|
||||||
|
|||||||
@ -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