dkforest

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

commit ad7307d70252097027700c1df7de4a9767a7362c
parent bccefc23268029765843538262a555e61d80b5f2
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Tue, 12 Dec 2023 14:24:08 -0500

save changes only after success sit

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

diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go @@ -1263,13 +1263,13 @@ func PokerSitHandler(c echo.Context) error { if tableAccount.PokerTable.IsTest { authUser.ChipsTest -= int(needed) } - authUser.DoSave(db) tableAccount.Amount += needed - tableAccount.DoSave(db) if err := g.SitPlayer(authUser, pos, tableAccount.Amount); err != nil { - fmt.Println(err) + PokerPubSub.Pub(roomUserTopic, ErrorMsgEvent{Message: err.Error()}) return c.HTML(http.StatusOK, html) } + authUser.DoSave(db) + tableAccount.DoSave(db) PokerPubSub.Pub(roomTopic, PokerSeatTakenEvent{}) newLogEvent(g, roomLogsTopic, fmt.Sprintf("%s sit", authUser.Username.String())) }