MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / handleConfirmInput

Method handleConfirmInput

internal/tui/auth_tab.go:370–393  ·  view source on GitHub ↗
(msg tea.KeyMsg)

Source from the content-addressed store, hash-verified

368}
369
370func (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
395func (m authTabModel) handleNormalInput(msg tea.KeyMsg) (authTabModel, tea.Cmd) {
396 switch msg.String() {

Callers 1

UpdateMethod · 0.95

Calls 5

renderContentMethod · 0.95
getStringFunction · 0.85
TFunction · 0.85
StringMethod · 0.45
DeleteAuthFileMethod · 0.45

Tested by

no test coverage detected