clean up logging
This commit is contained in:
parent
a163a91a83
commit
050e606b2a
5 changed files with 3 additions and 17 deletions
|
@ -24,7 +24,6 @@ pub fn Auth() -> impl IntoView {
|
||||||
let send_login = move |_| {
|
let send_login = move |_| {
|
||||||
if let Some(input) = username_input_ref.get() {
|
if let Some(input) = username_input_ref.get() {
|
||||||
if input.value() != String::from("") {
|
if input.value() != String::from("") {
|
||||||
logging::log!("send");
|
|
||||||
websocket.send(
|
websocket.send(
|
||||||
&to_string(&UserLogInRequest {
|
&to_string(&UserLogInRequest {
|
||||||
username: input.value(),
|
username: input.value(),
|
||||||
|
|
|
@ -66,9 +66,6 @@ pub fn Browser() -> impl IntoView {
|
||||||
.cloned()
|
.cloned()
|
||||||
.map(|game| {
|
.map(|game| {
|
||||||
view! {
|
view! {
|
||||||
{
|
|
||||||
logging::log!("I ran");
|
|
||||||
}
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="text-center border-b">{game.name}</td>
|
<td class="text-center border-b">{game.name}</td>
|
||||||
<td class="text-center border-b">{game.host}</td>
|
<td class="text-center border-b">{game.host}</td>
|
||||||
|
|
|
@ -44,9 +44,9 @@ pub fn CreateGame() -> impl IntoView {
|
||||||
let request_new_game = move |_| {
|
let request_new_game = move |_| {
|
||||||
if let Some(input) = new_game_name_ref.get() {
|
if let Some(input) = new_game_name_ref.get() {
|
||||||
if input.value() == *"" {
|
if input.value() == *"" {
|
||||||
logging::log!("New game name is empty!");
|
logging::error!("New game name is empty!");
|
||||||
} else if selected_packs().is_empty() {
|
} else if selected_packs().is_empty() {
|
||||||
logging::log!("New game selected packs is empty!");
|
logging::error!("New game selected packs is empty!");
|
||||||
} else {
|
} else {
|
||||||
set_websocket_send(
|
set_websocket_send(
|
||||||
to_string(&NewGameRequest {
|
to_string(&NewGameRequest {
|
||||||
|
@ -104,13 +104,11 @@ pub fn CreateGame() -> impl IntoView {
|
||||||
checked
|
checked
|
||||||
on:change=move |e| {
|
on:change=move |e| {
|
||||||
if event_target_checked(&e) {
|
if event_target_checked(&e) {
|
||||||
logging::log!("insert");
|
|
||||||
set_selected_packs
|
set_selected_packs
|
||||||
.update(|packs| {
|
.update(|packs| {
|
||||||
packs.insert(n.pack);
|
packs.insert(n.pack);
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
logging::log!("remove");
|
|
||||||
set_selected_packs
|
set_selected_packs
|
||||||
.update(|packs| {
|
.update(|packs| {
|
||||||
packs.remove(&n.pack);
|
packs.remove(&n.pack);
|
||||||
|
@ -148,13 +146,11 @@ pub fn CreateGame() -> impl IntoView {
|
||||||
id=n.pack
|
id=n.pack
|
||||||
on:change=move |e| {
|
on:change=move |e| {
|
||||||
if event_target_checked(&e) {
|
if event_target_checked(&e) {
|
||||||
logging::log!("insert");
|
|
||||||
set_selected_packs
|
set_selected_packs
|
||||||
.update(|packs| {
|
.update(|packs| {
|
||||||
packs.insert(n.pack);
|
packs.insert(n.pack);
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
logging::log!("remove");
|
|
||||||
set_selected_packs
|
set_selected_packs
|
||||||
.update(|packs| {
|
.update(|packs| {
|
||||||
packs.remove(&n.pack);
|
packs.remove(&n.pack);
|
||||||
|
|
|
@ -59,12 +59,6 @@ pub fn PlayingView() -> impl IntoView {
|
||||||
} else if selected_cards.get_untracked().contains(clicked_card)
|
} else if selected_cards.get_untracked().contains(clicked_card)
|
||||||
&& !submitted_cards.get_untracked().contains(clicked_card)
|
&& !submitted_cards.get_untracked().contains(clicked_card)
|
||||||
{
|
{
|
||||||
logging::log!(
|
|
||||||
"{:#?}\n{:#?}\n{:#?}",
|
|
||||||
clicked_card,
|
|
||||||
selected_cards(),
|
|
||||||
submitted_cards()
|
|
||||||
);
|
|
||||||
set_selected_cards.update(|cards| {
|
set_selected_cards.update(|cards| {
|
||||||
cards.remove(cards.iter().position(|card| card == clicked_card).unwrap());
|
cards.remove(cards.iter().position(|card| card == clicked_card).unwrap());
|
||||||
})
|
})
|
||||||
|
|
|
@ -122,7 +122,7 @@ pub fn Websocket() -> impl IntoView {
|
||||||
} else if let Ok(judge_update) = from_str::<JudgeRound>(message) {
|
} else if let Ok(judge_update) = from_str::<JudgeRound>(message) {
|
||||||
set_judge_round(Some(judge_update));
|
set_judge_round(Some(judge_update));
|
||||||
} else {
|
} else {
|
||||||
logging::log!("Unhandled message: {:#?}", message);
|
logging::error!("Unhandled message: {:#?}", message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue