dkforest

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

commit f6c8b72f59369134e3097c382efc3f8fec18a5f7
parent a3aa827e8226f0c4c8b527ab198ffb2ef38391bd
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Mon, 18 Dec 2023 15:09:23 -0500

cleanup

Diffstat:
Mpkg/web/handlers/handlers.go | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pkg/web/handlers/handlers.go b/pkg/web/handlers/handlers.go @@ -845,6 +845,7 @@ func PokerHomeHandler(c echo.Context) error { pokerTableSlug := c.Request().PostFormValue("table_slug") playerBuyIn := database.PokerChip(utils.DoParseUint64(c.Request().PostFormValue("buy_in"))) if err := db.WithE(func(tx *database.DkfDB) error { + authUserID := authUser.ID if g := poker.PokerInstance.GetGame(poker.RoomID(pokerTableSlug)); g != nil { g.Players.Lock() defer g.Players.Unlock() @@ -862,7 +863,7 @@ func PokerHomeHandler(c echo.Context) error { if playerBuyIn > pokerTable.MaxBuyIn { return errors.New("buy in too high") } - xmrBalance, chipsTestBalance, err := tx.GetUserBalances(authUser.ID) + xmrBalance, chipsTestBalance, err := tx.GetUserBalances(authUserID) if err != nil { return errors.New("failed to get user's balance") } @@ -870,7 +871,7 @@ func PokerHomeHandler(c echo.Context) error { if userChips < playerBuyIn { return errors.New("not enough chips to buy-in") } - tableAccount, err := tx.GetPokerTableAccount(authUser.ID, pokerTable.ID) + tableAccount, err := tx.GetPokerTableAccount(authUserID, pokerTable.ID) if err != nil { return errors.New("failed to get table account") }