Auto-dismiss error toasts after 10 seconds

This commit is contained in:
2026-09-18 09:18:17 +08:00
parent 294a93912d
commit f7fa8e78e5
6 changed files with 29 additions and 4 deletions
+2 -1
View File
@@ -3,6 +3,7 @@ use wasm_bindgen_futures::spawn_local;
use sycamore::prelude::*;
use crate::api;
use crate::components::toast::toast;
use crate::model::LeaderboardPage;
#[component]
@@ -24,7 +25,7 @@ pub fn LeaderboardPage() -> View {
a(href="/history") { "My matches" }
}
h1 { "Leaderboard" }
(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(p) => {