Feat: roomlist & join room

This commit is contained in:
Grail Finder
2025-05-09 14:39:33 +03:00
parent 45761446e5
commit 6c9c86f02b
10 changed files with 141 additions and 10 deletions

View File

@ -63,6 +63,15 @@ func HandleHome(w http.ResponseWriter, r *http.Request) {
return
}
fi, _ := getFullInfoByCtx(r.Context())
if fi != nil && fi.Room != nil && fi.State != nil {
if fi.State.Role == "mime" {
fi.Room.RevealAllCards()
}
}
if fi != nil && fi.Room == nil {
log.Debug("loading list")
fi.List = listPublicRooms()
}
log.Debug("data debug", "fi", fi)
if err := tmpl.ExecuteTemplate(w, "base", fi); err != nil {
log.Error("failed to exec templ;", "error", err, "templ", "base")