on main help sign in
fix(onboarding): fix y/n key press on model list and api key field (#402)
e69b513Andrey Nering
internal/tui/components/chat/splash/splash.go+14−10
@@ -262,30 +262,34 @@ func (s *splashCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
262 return s, nil
262 return s, nil
263 }
263 }
264 case key.Matches(msg, s.keyMap.Yes):
264 case key.Matches(msg, s.keyMap.Yes):
265− if s.isOnboarding {
266− return s, nil
267− }
268 if s.needsAPIKey {
265 if s.needsAPIKey {
269 u, cmd := s.apiKeyInput.Update(msg)
266 u, cmd := s.apiKeyInput.Update(msg)
270 s.apiKeyInput = u.(*models.APIKeyInput)
267 s.apiKeyInput = u.(*models.APIKeyInput)
271 return s, cmd
268 return s, cmd
272 }
269 }
273−
270+ if s.isOnboarding {
271+ u, cmd := s.modelList.Update(msg)
272+ s.modelList = u
273+ return s, cmd
274+ }
274 if s.needsProjectInit {
275 if s.needsProjectInit {
275 return s, s.initializeProject()
276 return s, s.initializeProject()
276 }
277 }
277 case key.Matches(msg, s.keyMap.No):
278 case key.Matches(msg, s.keyMap.No):
278− if s.isOnboarding {
279− return s, nil
280− }
281 if s.needsAPIKey {
279 if s.needsAPIKey {
282 u, cmd := s.apiKeyInput.Update(msg)
280 u, cmd := s.apiKeyInput.Update(msg)
283 s.apiKeyInput = u.(*models.APIKeyInput)
281 s.apiKeyInput = u.(*models.APIKeyInput)
284 return s, cmd
282 return s, cmd
285 }
283 }
286−
284+ if s.isOnboarding {
285+ u, cmd := s.modelList.Update(msg)
286+ s.modelList = u
287+ return s, cmd
288+ }
289+ if s.needsProjectInit {
287− s.selectedNo = true
290+ s.selectedNo = true
288− return s, s.initializeProject()
291+ return s, s.initializeProject()
292+ }
289 default:
293 default:
290 if s.needsAPIKey {
294 if s.needsAPIKey {
291 u, cmd := s.apiKeyInput.Update(msg)
295 u, cmd := s.apiKeyInput.Update(msg)