tryQuit attempts to quit the app. If any loop is running, it shows the quit confirmation dialog instead of quitting immediately.
()
| 867 | // tryQuit attempts to quit the app. If any loop is running, it shows the quit |
| 868 | // confirmation dialog instead of quitting immediately. |
| 869 | func (a App) tryQuit() (tea.Model, tea.Cmd) { |
| 870 | if a.manager != nil && a.manager.IsAnyRunning() { |
| 871 | a.previousViewMode = a.viewMode |
| 872 | a.viewMode = ViewQuitConfirm |
| 873 | a.quitConfirm.Reset() |
| 874 | a.quitConfirm.SetSize(a.width, a.height) |
| 875 | return a, nil |
| 876 | } |
| 877 | a.stopAllLoops() |
| 878 | a.stopWatcher() |
| 879 | return a, tea.Quit |
| 880 | } |
| 881 | |
| 882 | // handleQuitConfirmKeys handles keyboard input for the quit confirmation dialog. |
| 883 | func (a App) handleQuitConfirmKeys(msg tea.KeyMsg) (tea.Model, tea.Cmd) { |
no test coverage detected