mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-10-08 03:07:53 +00:00
feat(webview): Add marketplace checks in message handler
- Check marketplace enabled state before filtering items - Check marketplace enabled state before installation - Use cached state from provider for better performance - Add console logging for disabled marketplace operations
This commit is contained in:
parent
893d572aab
commit
58c9dc10b4
1 changed files with 12 additions and 20 deletions
|
|
@ -1465,12 +1465,10 @@ export const webviewMessageHandler = async (
|
|||
break
|
||||
}
|
||||
case "filterMarketplaceItems": {
|
||||
// Check if marketplace is enabled before making API calls
|
||||
const { experiments } = await provider.getState()
|
||||
const config = vscode.workspace.getConfiguration("roo-cline")
|
||||
const isMarketplaceDisabled = config.get<boolean>("disableMarketplace", false)
|
||||
// Get marketplace enabled state from provider's cached value
|
||||
const state = await provider.getStateToPostToWebview()
|
||||
|
||||
if (!experiments.marketplace || isMarketplaceDisabled) {
|
||||
if (!state.marketplaceEnabled) {
|
||||
console.log("Marketplace: Feature disabled, skipping API call")
|
||||
break
|
||||
}
|
||||
|
|
@ -1492,12 +1490,10 @@ export const webviewMessageHandler = async (
|
|||
}
|
||||
|
||||
case "installMarketplaceItem": {
|
||||
// Check if marketplace is enabled before installing
|
||||
const { experiments } = await provider.getState()
|
||||
const config = vscode.workspace.getConfiguration("roo-cline")
|
||||
const isMarketplaceDisabled = config.get<boolean>("disableMarketplace", false)
|
||||
// Get marketplace enabled state from provider's cached value
|
||||
const state = await provider.getStateToPostToWebview()
|
||||
|
||||
if (!experiments.marketplace || isMarketplaceDisabled) {
|
||||
if (!state.marketplaceEnabled) {
|
||||
console.log("Marketplace: Feature disabled, skipping installation")
|
||||
break
|
||||
}
|
||||
|
|
@ -1531,12 +1527,10 @@ export const webviewMessageHandler = async (
|
|||
}
|
||||
|
||||
case "removeInstalledMarketplaceItem": {
|
||||
// Check if marketplace is enabled before removing
|
||||
const { experiments } = await provider.getState()
|
||||
const config = vscode.workspace.getConfiguration("roo-cline")
|
||||
const isMarketplaceDisabled = config.get<boolean>("disableMarketplace", false)
|
||||
// Get marketplace enabled state from provider's cached value
|
||||
const state = await provider.getStateToPostToWebview()
|
||||
|
||||
if (!experiments.marketplace || isMarketplaceDisabled) {
|
||||
if (!state.marketplaceEnabled) {
|
||||
console.log("Marketplace: Feature disabled, skipping removal")
|
||||
break
|
||||
}
|
||||
|
|
@ -1553,12 +1547,10 @@ export const webviewMessageHandler = async (
|
|||
}
|
||||
|
||||
case "installMarketplaceItemWithParameters": {
|
||||
// Check if marketplace is enabled before installing with parameters
|
||||
const { experiments } = await provider.getState()
|
||||
const config = vscode.workspace.getConfiguration("roo-cline")
|
||||
const isMarketplaceDisabled = config.get<boolean>("disableMarketplace", false)
|
||||
// Get marketplace enabled state from provider's cached value
|
||||
const state = await provider.getStateToPostToWebview()
|
||||
|
||||
if (!experiments.marketplace || isMarketplaceDisabled) {
|
||||
if (!state.marketplaceEnabled) {
|
||||
console.log("Marketplace: Feature disabled, skipping installation with parameters")
|
||||
break
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue