fix: Fix 'q' key handling and connectivity status issues
- Fix 'q' key in detail/add/help screens to return to list instead of quitting - Only quit application with 'q' when on main list screen - Fix parseHandshake to accumulate all time units instead of returning early This resolves handshake timing discrepancy with wg show output - Increase connection status threshold from 3 to 5 minutes Allows ~12 missed keepalive intervals (25s each) Improves connectivity status accuracy for peers with marginal connections
This commit is contained in:
@@ -47,10 +47,13 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
|
||||
switch msg := msg.(type) {
|
||||
case tea.KeyMsg:
|
||||
switch msg.String() {
|
||||
case "q", "ctrl+c":
|
||||
// Only quit on 'q' when on list screen
|
||||
// Other screens handle 'q' to navigate back
|
||||
if _, ok := m.currentScreen.(*screens.ListScreen); ok && (msg.String() == "q" || msg.String() == "ctrl+c") {
|
||||
m.quitting = true
|
||||
return m, tea.Quit
|
||||
}
|
||||
switch msg.String() {
|
||||
case "?":
|
||||
// Switch to help screen
|
||||
m.previousScreen = m.currentScreen
|
||||
|
||||
Reference in New Issue
Block a user