(msg tea.KeyMsg)
| 368 | } |
| 369 | |
| 370 | func (m authTabModel) handleConfirmInput(msg tea.KeyMsg) (authTabModel, tea.Cmd) { |
| 371 | switch msg.String() { |
| 372 | case "y", "Y": |
| 373 | idx := m.confirm |
| 374 | m.confirm = -1 |
| 375 | if idx < len(m.files) { |
| 376 | name := getString(m.files[idx], "name") |
| 377 | return m, func() tea.Msg { |
| 378 | err := m.client.DeleteAuthFile(name) |
| 379 | if err != nil { |
| 380 | return authActionMsg{err: err} |
| 381 | } |
| 382 | return authActionMsg{action: fmt.Sprintf(T("deleted"), name)} |
| 383 | } |
| 384 | } |
| 385 | m.viewport.SetContent(m.renderContent()) |
| 386 | return m, nil |
| 387 | case "n", "N", "esc": |
| 388 | m.confirm = -1 |
| 389 | m.viewport.SetContent(m.renderContent()) |
| 390 | return m, nil |
| 391 | } |
| 392 | return m, nil |
| 393 | } |
| 394 | |
| 395 | func (m authTabModel) handleNormalInput(msg tea.KeyMsg) (authTabModel, tea.Cmd) { |
| 396 | switch msg.String() { |
no test coverage detected