commit a7795c25d99df78bf786775deda44b9f6b441d05
parent e9b5e353b986fa7dc00d88ffa02dc398d4a69ed3
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Tue, 19 Dec 2023 12:21:37 -0500
cleanup
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go
@@ -1834,7 +1834,7 @@ func drawSeatsStyle(authUser *database.User, g *PokerGame) string {
html += drawSeatCashLabel(idxStr, itoa2(p.getCash()))
if ongoing != nil {
if op := ongoing.getPlayer(pUserID); op != nil && op.getBet() > 0 {
- html += fmt.Sprintf(`#seat%sPot:before { content: "%s"; }`, idxStr, itoa2(op.getBet()))
+ html += drawSeatPotLabel(idxStr, itoa2(op.getBet()))
}
}
} else {
@@ -1848,6 +1848,10 @@ func drawSeatsStyle(authUser *database.User, g *PokerGame) string {
return html
}
+func drawSeatPotLabel(seatIdxStr, betStr string) string {
+ return fmt.Sprintf(`#seat%sPot:before { content: "%s"; }`, seatIdxStr, betStr)
+}
+
func drawSeatCashLabel(seatIdxStr, cashStr string) string {
return fmt.Sprintf(`#seat%s_cash:before { content: "%s"; }`, seatIdxStr, cashStr)
}
@@ -1867,7 +1871,7 @@ func drawErrorMsgEvent(evt ErrorMsgEvent) (html string) {
func drawPlayerBetEvent(evt PlayerBetEvent) (html string) {
idxStr := itoa(evt.PlayerSeatIdx + 1)
html += `<style>`
- html += fmt.Sprintf(`#seat%sPot:before { content: "%s"; }`, idxStr, itoa2(evt.TotalBet))
+ html += drawSeatPotLabel(idxStr, itoa2(evt.TotalBet))
html += drawSeatCashLabel(idxStr, itoa2(evt.Cash))
html += `</style>`
return