clear hand when changing games
This commit is contained in:
parent
c5b5092a3c
commit
fc33f0fef8
1 changed files with 5 additions and 0 deletions
|
@ -34,6 +34,11 @@ pub fn Game() -> impl IntoView {
|
||||||
set_game_czar(game.czar.clone());
|
set_game_czar(game.czar.clone());
|
||||||
set_game_black(game.black.clone());
|
set_game_black(game.black.clone());
|
||||||
set_game_white(game.white.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 {
|
for card in game.white {
|
||||||
set_player_hand.update(|hand| {
|
set_player_hand.update(|hand| {
|
||||||
hand.insert(card.uuid.clone(), card.clone());
|
hand.insert(card.uuid.clone(), card.clone());
|
||||||
|
|
Loading…
Add table
Reference in a new issue