tui: remove quit dialog (#97)

pull/103/head
Albert Ilagan 2025-06-15 01:47:34 +08:00 committed by GitHub
parent a53f9165e9
commit 0239761f31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 9 deletions

View File

@ -92,13 +92,7 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
a.modal = nil
return a, nil
case "ctrl+c":
if _, ok := a.modal.(dialog.QuitDialog); ok {
return a, tea.Quit
} else {
quitDialog := dialog.NewQuitDialog()
a.modal = quitDialog
return a, nil
}
return a, tea.Quit
}
// don't send commands to the modal
@ -135,8 +129,7 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
case commands.ExecuteCommandMsg:
switch msg.Name {
case "quit":
quitDialog := dialog.NewQuitDialog()
a.modal = quitDialog
return a, tea.Quit
case "new":
a.app.Session = &client.SessionInfo{}
a.app.Messages = []client.MessageInfo{}