do frontend (preact)

This commit is contained in:
2026-11-21 02:07:32 +01:00
parent 040bd10d97
commit 405ea5a23c
32 changed files with 1512 additions and 31 deletions

View File

@@ -131,6 +131,7 @@ pub async fn websocket(
ws.on_upgrade(async move |mut socket| {
let mut subscription = state.leaderboard.subscribe();
// let mut first = true;
loop {
let payload = {
let LeaderboardWatchedInfo {
@@ -138,6 +139,13 @@ pub async fn websocket(
ref message,
} = *subscription.borrow_and_update();
// for testing the error message:
// if first {
// first = false;
// format!("{}\tok\t{data}", expiry.to_rfc3339())
// } else {
// format!("{}\terr\terrormessage", expiry.to_rfc3339())
// }
match message {
Ok(data) => format!("{}\tok\t{data}", expiry.to_rfc3339()),
Err(err) => format!("{}\terr\t{err}", expiry.to_rfc3339()),