mirror of
https://github.com/Kyren223/eko.git
synced 2026-07-14 08:00:25 +00:00
Fixed color issue on the server, made the UI have better UX
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user