Skip to content

Commit 0f20b57

Browse files
committed
feat(validate): Update verification location
Update verification location Signed-off-by: mritd <[email protected]>
1 parent 795c4db commit 0f20b57

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

ui_commit_inputs.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,13 @@ func (m inputsModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
145145
m.inputs[i].input.TextStyle = inputsTextNormalStyle
146146
}
147147

148+
if m.focusIndex < len(m.inputs) && m.inputs[m.focusIndex].checker != nil {
149+
m.err = m.inputs[m.focusIndex].checker(m.inputs[m.focusIndex].input.Value())
150+
cmds = append(cmds, spinner.Tick)
151+
} else {
152+
m.err = nil
153+
}
154+
148155
return m, tea.Batch(cmds...)
149156
}
150157
case string:
@@ -171,11 +178,6 @@ func (m *inputsModel) updateInputs(msg tea.Msg) tea.Cmd {
171178
m.inputs[i].input, cmds[i] = m.inputs[i].input.Update(msg)
172179
}
173180

174-
if m.focusIndex < len(m.inputs) && m.inputs[m.focusIndex].checker != nil {
175-
m.err = m.inputs[m.focusIndex].checker(m.inputs[m.focusIndex].input.Value())
176-
cmds[len(m.inputs)] = spinner.Tick
177-
}
178-
179181
return tea.Batch(cmds...)
180182
}
181183

0 commit comments

Comments
 (0)