don't move cards if submitted

This commit is contained in:
Adam 2024-09-02 15:04:32 -04:00
parent 79b512ad3c
commit 98fa49046a

View file

@ -47,6 +47,7 @@ pub fn PlayingView() -> impl IntoView {
// Toggle selected status of cards
create_effect(move |_| {
if card_clicked() != "".to_string()
&& !submitted()
&& submitted_cards().len() < game_meta().unwrap().black.1.into()
{
if let Some(clicked_card) = player_hand
@ -114,6 +115,7 @@ pub fn PlayingView() -> impl IntoView {
view! { <WhiteCard card_data=card /> }
}
/>
</div>
// Submit button
@ -124,6 +126,7 @@ pub fn PlayingView() -> impl IntoView {
view! { <p>"Card(s) submitted. Waiting for other players..."</p> }
}
>
<button type="button" on:click=submit_move.clone()>
Submit
</button>
@ -154,6 +157,7 @@ pub fn PlayingView() -> impl IntoView {
}
}
/>
</div>
}
}