(marketplace: MarketplaceState)
| 389 | |
| 390 | // Handle toggling auto-update for a marketplace |
| 391 | const handleToggleAutoUpdate = async (marketplace: MarketplaceState) => { |
| 392 | const newAutoUpdate = !marketplace.autoUpdate; |
| 393 | try { |
| 394 | await setMarketplaceAutoUpdate(marketplace.name, newAutoUpdate); |
| 395 | |
| 396 | // Update local state |
| 397 | setMarketplaceStates(prev => prev.map(state => state.name === marketplace.name ? { |
| 398 | ...state, |
| 399 | autoUpdate: newAutoUpdate |
| 400 | } : state)); |
| 401 | |
| 402 | // Update selected marketplace reference |
| 403 | setSelectedMarketplace(prev => prev ? { |
| 404 | ...prev, |
| 405 | autoUpdate: newAutoUpdate |
| 406 | } : prev); |
| 407 | } catch (err) { |
| 408 | setProcessError(err instanceof Error ? err.message : 'Failed to update setting'); |
| 409 | } |
| 410 | }; |
| 411 | |
| 412 | // Escape in details or confirm-remove view - go back to list |
| 413 | useKeybinding('confirm:no', () => { |
no test coverage detected