MCPcopy
hub / github.com/SurgeDM/Surge / updateDuplicateWarning

Method updateDuplicateWarning

internal/tui/update_modals.go:164–189  ·  view source on GitHub ↗
(msg tea.KeyPressMsg)

Source from the content-addressed store, hash-verified

162}
163
164func (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
191func (m RootModel) updateQuitConfirm(msg tea.KeyPressMsg) (tea.Model, tea.Cmd) {
192

Callers 1

UpdateMethod · 0.95

Calls 3

startDownloadMethod · 0.95
getFilteredDownloadsMethod · 0.95

Tested by

no test coverage detected