Auto-dismiss error toasts after 10 seconds

This commit is contained in:
woggioni committed 2026-09-18 19:14:49 +08:00
1 parent 294a93912d
commit bf04a9b38d
6 files changed
+29 -4

No files matched your search

+2 -1
View File
@@ -4,6 +4,7 @@ use sycamore::prelude::*;
use sycamore_router::navigate;
use crate::api;
use crate::components::toast::toast;
use crate::model::{GameTypeInfo, User};
/// Used when the game-types fetch fails: match creation must still work.
@@ -70,7 +71,7 @@ pub fn LobbyPage() -> View {
view! {
div(class="lobby") {
h1 { "Scopone scientifico" }
(move || error.get_clone().map(|e| view! { div(class="toast") { (e) } }))
(toast(error))
(move || match user.get_clone() {
None => view! { p(class="status") { "Loading…" } },
Some(None) => view! {