* Remove a marketplace from extraKnownMarketplaces in the given settings sources, * and also remove any associated enabled plugins.
(name: string, sources: Array<{
source: EditableSettingSource;
}>)
| 315 | * and also remove any associated enabled plugins. |
| 316 | */ |
| 317 | function removeExtraMarketplace(name: string, sources: Array<{ |
| 318 | source: EditableSettingSource; |
| 319 | }>): void { |
| 320 | for (const { |
| 321 | source |
| 322 | } of sources) { |
| 323 | const settings = getSettingsForSource(source); |
| 324 | if (!settings) continue; |
| 325 | const updates: Record<string, unknown> = {}; |
| 326 | |
| 327 | // Remove from extraKnownMarketplaces |
| 328 | if (settings.extraKnownMarketplaces?.[name]) { |
| 329 | updates.extraKnownMarketplaces = { |
| 330 | ...settings.extraKnownMarketplaces, |
| 331 | [name]: undefined |
| 332 | }; |
| 333 | } |
| 334 | |
| 335 | // Remove associated enabled plugins (format: "plugin@marketplace") |
| 336 | if (settings.enabledPlugins) { |
| 337 | const suffix = `@${name}`; |
| 338 | let removedPlugins = false; |
| 339 | const updatedPlugins = { |
| 340 | ...settings.enabledPlugins |
| 341 | }; |
| 342 | for (const pluginId in updatedPlugins) { |
| 343 | if (pluginId.endsWith(suffix)) { |
| 344 | updatedPlugins[pluginId] = undefined; |
| 345 | removedPlugins = true; |
| 346 | } |
| 347 | } |
| 348 | if (removedPlugins) { |
| 349 | updates.enabledPlugins = updatedPlugins; |
| 350 | } |
| 351 | } |
| 352 | if (Object.keys(updates).length > 0) { |
| 353 | updateSettingsForSource(source, updates); |
| 354 | } |
| 355 | } |
| 356 | } |
| 357 | function ErrorsTabContent(t0) { |
| 358 | const $ = _c(26); |
| 359 | const { |
no test coverage detected