Enha: state to hold room_id instead of whole room

This commit is contained in:
Grail Finder
2025-05-08 10:25:38 +03:00
parent 3ade7310a7
commit b20f7ac6b7
12 changed files with 110 additions and 35 deletions

View File

@ -2,7 +2,6 @@ package handlers
import (
"golias/config"
"golias/models"
"golias/pkg/cache"
"html/template"
"log/slog"
@ -63,13 +62,8 @@ func HandleHome(w http.ResponseWriter, r *http.Request) {
abortWithError(w, err.Error())
return
}
userState, _ := getStateByCtx(r.Context())
if userState == nil {
userState = &models.UserState{}
fi, _ := getFullInfoByCtx(r.Context())
if err := tmpl.ExecuteTemplate(w, "base", fi); err != nil {
log.Error("failed to exec templ;", "error", err, "templ", "base")
}
// if err != nil {
// abortWithError(w, err.Error())
// return
// }
tmpl.ExecuteTemplate(w, "base", userState)
}