Feat: components chain

This commit is contained in:
Grail Finder
2025-05-03 09:18:05 +03:00
parent 8b68aee884
commit 5cf1f1199e
7 changed files with 73 additions and 50 deletions

View File

@ -2,6 +2,7 @@ package handlers
import (
"golias/config"
"golias/models"
"golias/pkg/cache"
"html/template"
"log/slog"
@ -43,6 +44,14 @@ func HandleHome(w http.ResponseWriter, r *http.Request) {
return
}
// check if user in a room
roomID := getRoomIDFromCtx(r.Context())
tmpl.ExecuteTemplate(w, "main", roundWords)
// roomID := getRoomIDFromCtx(r.Context())
// roomID = "test-id"
// if roomID != "" {
// // get room data
// userState := models.MakeTestState()
// tmpl.ExecuteTemplate(w, "room", userState)
// return
// }
userState := models.MakeTestState()
tmpl.ExecuteTemplate(w, "main", userState)
}