dkforest

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

commit f9468b1dc9c5201eec7839c25b212914ac2a9624
parent 8f0e29c20fcb02623d755185dd9d6e4edbbb82ba
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Mon, 12 Jun 2023 15:52:09 -0700

do not display form if game is over

Diffstat:
Mpkg/web/handlers/chess.go | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/pkg/web/handlers/chess.go b/pkg/web/handlers/chess.go @@ -117,6 +117,10 @@ func ChessGameFormHandler(c echo.Context) error { g := interceptors.ChessInstance.GetGame(key) isFlipped := authUser.ID == g.Player2.ID + if g.Game.Outcome() != chess.NoOutcome { + return c.NoContent(http.StatusOK) + } + htmlTmpl := cssReset + interceptors.ChessCSS + ` <form method="post" action="/chess/{{ .Key }}"> <input type="hidden" name="csrf" value="{{ .CSRF }}" />