Fixed color issue on the server, made the UI have better UX

This commit is contained in:
2024-11-27 17:44:38 +02:00
parent 6a5131792f
commit 0aa83227da
3 changed files with 6 additions and 5 deletions

View File

@@ -144,7 +144,11 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
case tea.KeyEnter:
if m.networkCreationPopup != nil {
return m, m.networkCreationPopup.Select()
cmd := m.networkCreationPopup.Select()
if cmd != nil {
m.networkCreationPopup = nil
}
return m, cmd
}
default:

View File

@@ -95,9 +95,6 @@ func New() Model {
if strings.TrimSpace(s) == "" {
return errors.New("cannot be empty")
}
if strings.TrimSpace(s) != s {
return errors.New("no leading/trailing spaces")
}
return nil
}

View File

@@ -13,7 +13,7 @@ func isValidHexColor(color string) (bool, string) {
return false, "color must start with '#'"
}
for _, c := range color {
for _, c := range color[1:] {
if !strings.ContainsRune(hex, c) {
return false, "color must start with '#' and contain exactly 6 digits 0-9, a-f, A-F"
}