From fc33f0fef84a0232ab0d8b4832387913dffee52d Mon Sep 17 00:00:00 2001 From: Adam <24621027+adoyle0@users.noreply.github.com> Date: Sun, 18 Aug 2024 19:21:12 -0400 Subject: [PATCH] clear hand when changing games --- client/src/components/game.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/src/components/game.rs b/client/src/components/game.rs index 385ceff..75b7f11 100644 --- a/client/src/components/game.rs +++ b/client/src/components/game.rs @@ -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());