diff --git a/client/src/components/game/views/judging.rs b/client/src/components/game/views/judging.rs index 77411bf..de8a83d 100644 --- a/client/src/components/game/views/judging.rs +++ b/client/src/components/game/views/judging.rs @@ -67,21 +67,23 @@ pub fn JudgingView() -> impl IntoView { // Judging Submit Handler let submit_judge = move |_| { - let msg = to_string(&JudgeDecisionRequest { - game_id: game_meta().unwrap().uuid.clone(), - winning_cards: selected_cards() - .iter() - .map(|card| card.uuid.clone()) - .collect(), - }) - .unwrap(); + if !selected_cards().is_empty() { + let msg = to_string(&JudgeDecisionRequest { + game_id: game_meta().unwrap().uuid.clone(), + winning_cards: selected_cards() + .iter() + .map(|card| card.uuid.clone()) + .collect(), + }) + .unwrap(); - websocket.send(&msg); - set_selected_cards.update(|list| { - list.clear(); - }); + websocket.send(&msg); + set_selected_cards.update(|list| { + list.clear(); + }); - set_judge_round(None); + set_judge_round(None); + } }; view! {