fix being able to submit 0 cards when judging and locking up the game
This commit is contained in:
parent
8cb04a4eb3
commit
0d1d1bf602
1 changed files with 15 additions and 13 deletions
|
@ -67,21 +67,23 @@ pub fn JudgingView() -> impl IntoView {
|
||||||
|
|
||||||
// Judging Submit Handler
|
// Judging Submit Handler
|
||||||
let submit_judge = move |_| {
|
let submit_judge = move |_| {
|
||||||
let msg = to_string(&JudgeDecisionRequest {
|
if !selected_cards().is_empty() {
|
||||||
game_id: game_meta().unwrap().uuid.clone(),
|
let msg = to_string(&JudgeDecisionRequest {
|
||||||
winning_cards: selected_cards()
|
game_id: game_meta().unwrap().uuid.clone(),
|
||||||
.iter()
|
winning_cards: selected_cards()
|
||||||
.map(|card| card.uuid.clone())
|
.iter()
|
||||||
.collect(),
|
.map(|card| card.uuid.clone())
|
||||||
})
|
.collect(),
|
||||||
.unwrap();
|
})
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
websocket.send(&msg);
|
websocket.send(&msg);
|
||||||
set_selected_cards.update(|list| {
|
set_selected_cards.update(|list| {
|
||||||
list.clear();
|
list.clear();
|
||||||
});
|
});
|
||||||
|
|
||||||
set_judge_round(None);
|
set_judge_round(None);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
view! {
|
view! {
|
||||||
|
|
Loading…
Add table
Reference in a new issue