on main help sign in
fix(ui): dialog: saveKeyAndContinue should return Action
fedf059Ayman Bagabas
internal/ui/dialog/api_key_input.go+2−2
@@ -286,12 +286,12 @@ func (m *APIKeyInput) verifyAPIKey() tea.Msg {
286 return ActionChangeAPIKeyState{APIKeyInputStateError}
286 return ActionChangeAPIKeyState{APIKeyInputStateError}
287}
287}
288
288
289−func (m *APIKeyInput) saveKeyAndContinue() tea.Msg {
289+func (m *APIKeyInput) saveKeyAndContinue() Action {
290 cfg := m.com.Config()
290 cfg := m.com.Config()
291
291
292 err := cfg.SetProviderAPIKey(string(m.provider.ID), m.input.Value())
292 err := cfg.SetProviderAPIKey(string(m.provider.ID), m.input.Value())
293 if err != nil {
293 if err != nil {
294− return uiutil.ReportError(fmt.Errorf("failed to save API key: %w", err))
294+ return ActionCmd{uiutil.ReportError(fmt.Errorf("failed to save API key: %w", err))}
295 }
295 }
296
296
297 return ActionSelectModel{
297 return ActionSelectModel{