(msg tea.KeyPressMsg)
| 162 | } |
| 163 | |
| 164 | func (m RootModel) updateDuplicateWarning(msg tea.KeyPressMsg) (tea.Model, tea.Cmd) { |
| 165 | if key.Matches(msg, m.keys.Duplicate.Continue) { |
| 166 | // Continue anyway - startDownload handles unique filename generation |
| 167 | m.state = DashboardState |
| 168 | updated, cmd := m.startDownload(m.pendingURL, m.pendingMirrors, m.pendingHeaders, m.pendingPath, m.pendingIsDefaultPath, m.pendingFilename, "") |
| 169 | nextModel, nextCmd := updated.showNextPendingRequest() |
| 170 | return nextModel, tea.Batch(cmd, nextCmd) |
| 171 | } |
| 172 | if key.Matches(msg, m.keys.Duplicate.Cancel) { |
| 173 | // Cancel - don't add |
| 174 | m.state = DashboardState |
| 175 | return m.showNextPendingRequest() |
| 176 | } |
| 177 | if key.Matches(msg, m.keys.Duplicate.Focus) { |
| 178 | // Focus existing download - find it and select in list |
| 179 | for i, d := range m.getFilteredDownloads() { |
| 180 | if d.URL == m.pendingURL { |
| 181 | m.list.Select(i) |
| 182 | break |
| 183 | } |
| 184 | } |
| 185 | m.state = DashboardState |
| 186 | return m.showNextPendingRequest() |
| 187 | } |
| 188 | return m, nil |
| 189 | } |
| 190 | |
| 191 | func (m RootModel) updateQuitConfirm(msg tea.KeyPressMsg) (tea.Model, tea.Cmd) { |
| 192 |
no test coverage detected