From c4aa9353a8bf4de5bc1d0c507465c325d6eb54e6 Mon Sep 17 00:00:00 2001 From: Alex Janka Date: Thu, 28 Dec 2023 13:28:48 +1100 Subject: [PATCH] flash button --- client/src/main.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/client/src/main.rs b/client/src/main.rs index 880050a..d21894f 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -40,10 +40,25 @@ fn App() -> Html { html! {

{text}

} }) .collect(); + let flash = move |_| { + wasm_bindgen_futures::spawn_local(async move { + match reqwasm::http::Request::get(&format!("{API_URL}/flash")) + .send() + .await + { + Ok(response) => match response.json::().await { + Ok(_) => {} + Err(e) => println!("error getting text: {e:#?}"), + }, + Err(e) => println!("request error: {e:#?}"), + } + }) + }; html! {
{text_elements} +
} }