Auto-dismiss error toasts after 10 seconds
This commit is contained in:
@@ -3,6 +3,7 @@ use wasm_bindgen_futures::spawn_local;
|
||||
use sycamore::prelude::*;
|
||||
|
||||
use crate::api;
|
||||
use crate::components::toast::toast;
|
||||
use crate::model::MatchesPage;
|
||||
|
||||
#[component]
|
||||
@@ -45,7 +46,7 @@ pub fn HistoryPage() -> View {
|
||||
a(href="/leaderboard") { "Leaderboard" }
|
||||
}
|
||||
h1 { "My matches" }
|
||||
(move || error.get_clone().map(|e| view! { div(class="toast") { (e) } }))
|
||||
(toast(error))
|
||||
(move || match page.get_clone() {
|
||||
None => view! { p(class="status") { "Loading…" } },
|
||||
Some(_) if rows.get_clone().is_empty() => view! {
|
||||
|
||||
Reference in New Issue
Block a user