@@ -372,6 +372,11 @@ func (a *appModel) handleKeyPressMsg(msg tea.KeyPressMsg) tea.Cmd {
372372 return cmd
373373 }
374374 }
375+ if a.dialog.HasDialogs() {
376+ u, dialogCmd := a.dialog.Update(msg)
377+ a.dialog = u.(dialogs.DialogCmp)
378+ return dialogCmd
379+ }
375380 switch {
376381 // help
377382 case key.Matches(msg, a.keyMap.Help):
@@ -432,20 +437,14 @@ func (a *appModel) handleKeyPressMsg(msg tea.KeyPressMsg) tea.Cmd {
432437 }
433438 return tea.Suspend
434439 default:
435− if a.dialog.HasDialogs() {
436− u, dialogCmd := a.dialog.Update(msg)
437− a.dialog = u.(dialogs.DialogCmp)
438− return dialogCmd
439− } else {
440− item, ok := a.pages[a.currentPage]
441− if !ok {
442− return nil
443− }
444−
445− updated, cmd := item.Update(msg)
446− a.pages[a.currentPage] = updated.(util.Model)
447− return cmd
440+ item, ok := a.pages[a.currentPage]
441+ if !ok {
442+ return nil
448443 }
444+
445+ updated, cmd := item.Update(msg)
446+ a.pages[a.currentPage] = updated.(util.Model)
447+ return cmd
449448 }
450449}
451450