(marketplace: MarketplaceState | null)
| 355 | |
| 356 | // Build menu options for details view |
| 357 | const buildDetailsMenuOptions = (marketplace: MarketplaceState | null): Array<{ |
| 358 | label: string; |
| 359 | secondaryLabel?: string; |
| 360 | value: string; |
| 361 | }> => { |
| 362 | if (!marketplace) return []; |
| 363 | const options: Array<{ |
| 364 | label: string; |
| 365 | secondaryLabel?: string; |
| 366 | value: string; |
| 367 | }> = [{ |
| 368 | label: `Browse plugins (${marketplace.pluginCount ?? 0})`, |
| 369 | value: 'browse' |
| 370 | }, { |
| 371 | label: 'Update marketplace', |
| 372 | secondaryLabel: marketplace.lastUpdated ? `(last updated ${new Date(marketplace.lastUpdated).toLocaleDateString()})` : undefined, |
| 373 | value: 'update' |
| 374 | }]; |
| 375 | |
| 376 | // Only show auto-update toggle if auto-updater is not globally disabled |
| 377 | if (!shouldSkipPluginAutoupdate()) { |
| 378 | options.push({ |
| 379 | label: marketplace.autoUpdate ? 'Disable auto-update' : 'Enable auto-update', |
| 380 | value: 'toggle-auto-update' |
| 381 | }); |
| 382 | } |
| 383 | options.push({ |
| 384 | label: 'Remove marketplace', |
| 385 | value: 'remove' |
| 386 | }); |
| 387 | return options; |
| 388 | }; |
| 389 | |
| 390 | // Handle toggling auto-update for a marketplace |
| 391 | const handleToggleAutoUpdate = async (marketplace: MarketplaceState) => { |
no test coverage detected