Enha: state to hold room_id instead of whole room
This commit is contained in:
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user