dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit c6e646886b3d7cb1b34237324fc8bc33400e14ab
parent cda8c8c9c87c378b89834cf1b1d405f255de0ed8
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Sat,  9 Dec 2023 05:47:19 -0500

cleanup

Diffstat:
Mpkg/web/handlers/poker/poker.go | 19++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go @@ -1239,18 +1239,6 @@ func buildCardsHtml() (html string) { return } -func buildTakeSeatHtml(authUser *database.User, g *PokerGame, roomID string) string { - takeSeatBtns := "" - seated, _ := g.IsSeated(authUser.Username.String()) - for i, p := range g.Players { - takeSeatBtns += `` - if p != nil || seated { - takeSeatBtns += `<style>.takeSeat` + itoa(i+1) + ` { display: none; }</style>` - } - } - return takeSeatBtns -} - func buildMainPotHtml(g *PokerGame) string { html := `<div id="mainPot"></div>` mainPot := 0 @@ -1302,8 +1290,14 @@ func buildSeatsHtml(g *PokerGame, authUser *database.User, roomID string) (seats } seats += `</div>` + seated, _ := g.IsSeated(authUser.Username.String()) seats += `<style>` for i, p := range g.Players { + if p != nil || seated { + seats += `.takeSeat` + itoa(i+1) + ` { display: none; }` + } else { + seats += `.takeSeat` + itoa(i+1) + ` { display: block; }` + } if p != nil { if p.Username == authUser.Username.String() { seats += `#seat` + itoa(i+1) + ` { border: 2px solid #0d1b8f; }` @@ -1788,7 +1782,6 @@ func PokerHandler(c echo.Context) error { send(`<div id="table"></div>`) //send(buildDevHtml()) send(buildCardsHtml()) - send(buildTakeSeatHtml(authUser, g, roomID)) send(buildSeatsHtml(g, authUser, roomID)) send(buildActionsDiv(roomID)) send(buildYourCardsHtml(authUser, g))