Limit chars of username client side to avoid getting an error from the

server
This commit is contained in:
2025-02-28 21:26:10 +02:00
parent 0afb682db1
commit 439af03aeb

View File

@@ -76,7 +76,7 @@ func New() Model {
name.FocusedTextStyle = focusedTextStyle
name.BlurredTextStyle = blurredTextStyle
name.ErrorStyle = lipgloss.NewStyle().Foreground(colors.Error)
name.Input.CharLimit = width
name.Input.CharLimit = packet.MaxUsernameBytes
name.Focus()
name.Input.Validate = func(s string) error {
if strings.TrimSpace(s) == "" {