fix: display correct button on unauthed room page

This commit is contained in:
efim
2023-11-23 06:14:54 +00:00
parent f7def011f5
commit 550841e882
2 changed files with 5 additions and 5 deletions

View File

@@ -34,7 +34,7 @@ func registerLoginRoutes(
) {
// login page
http.HandleFunc(loginPath, func(w http.ResponseWriter, r *http.Request) {
renderLoginPage(w, "")
renderLoginPage(w, "", false)
})
http.HandleFunc("/login/join", joinRoomHandler(templateFs, sessionSM, roomsM))
http.HandleFunc("/login/create", createRoomHandler(templateFs, sessionSM, roomsM))
@@ -107,7 +107,7 @@ func authedPageMiddleware(
})
}
func renderLoginPage(w http.ResponseWriter, roomName string) {
func renderLoginPage(w http.ResponseWriter, roomName string, isRoomExisting bool) {
baseFile := "templates/base.gohtml"
pageTempl := "templates/login.gohtml"
loginSecion := "templates/login-section.gohtml"
@@ -123,7 +123,7 @@ func renderLoginPage(w http.ResponseWriter, roomName string) {
},
Content: loginPageData{
LoginSection: LoginSectionData{
IsRoomExisting: false,
IsRoomExisting: isRoomExisting,
RoomName: roomName,
},
},