commit 9953a87f5f447785c416b42807367d3367ae0ff7
parent 6c8520cff34e29d38820f6a16841aa14704173af
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Tue, 19 Dec 2023 02:08:05 -0500
cleanup
Diffstat:
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go
@@ -1812,20 +1812,14 @@ func drawSeatsStyle(authUser *database.User, g *PokerGame) string {
}
func drawAutoActionMsgEvent(evt AutoActionEvent) (html string) {
- if evt.Message != "" {
- html += `<style>#autoAction { display: block; } #autoAction:before { content: "` + evt.Message + `"; }</style>`
- } else {
- html += `<style>#autoAction { display: none; } #autoAction:before { content: ""; }</style>`
- }
+ display := utils.Ternary(evt.Message != "", "block", "none")
+ html += `<style>#autoAction { display: ` + display + `; } #autoAction:before { content: "` + evt.Message + `"; }</style>`
return
}
func drawErrorMsgEvent(evt ErrorMsgEvent) (html string) {
- if evt.Message != "" {
- html += `<style>#errorMsg { display: block; } #errorMsg:before { content: "` + evt.Message + `"; }</style>`
- } else {
- html += `<style>#errorMsg { display: none; } #errorMsg:before { content: ""; }</style>`
- }
+ display := utils.Ternary(evt.Message != "", "block", "none")
+ html += `<style>#errorMsg { display: ` + display + `; } #errorMsg:before { content: "` + evt.Message + `"; }</style>`
return
}