clear hand when changing games

This commit is contained in:
Adam 2024-08-18 19:21:12 -04:00
parent c5b5092a3c
commit fc33f0fef8

View file

@ -34,6 +34,11 @@ pub fn Game() -> impl IntoView {
set_game_czar(game.czar.clone());
set_game_black(game.black.clone());
set_game_white(game.white.clone());
// Primitive reset when joining new game
set_player_hand(HashMap::new());
// Load hand
for card in game.white {
set_player_hand.update(|hand| {
hand.insert(card.uuid.clone(), card.clone());