mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
fix: update global state for backward compatibility
- Maintain global state updates alongside tab-specific state - Ensure tests pass by updating both global and tab-specific state - Keep backward compatibility with existing components
This commit is contained in:
parent
bb529ead01
commit
822eca3923
1 changed files with 10 additions and 3 deletions
|
|
@ -1166,9 +1166,12 @@ export class ClineProvider
|
|||
}
|
||||
}
|
||||
|
||||
// Update tab-specific mode instead of global state
|
||||
// Update tab-specific mode
|
||||
this.tabSpecificMode = newMode
|
||||
|
||||
// Also update global state for backward compatibility with tests and other components
|
||||
await this.updateGlobalState("mode", newMode)
|
||||
|
||||
this.emit(RooCodeEventName.ModeChanged, newMode)
|
||||
|
||||
// Load the saved API config for the new mode if it exists.
|
||||
|
|
@ -1297,6 +1300,9 @@ export class ClineProvider
|
|||
async activateProviderProfile(args: { name: string } | { id: string }) {
|
||||
const { name, id, ...providerSettings } = await this.providerSettingsManager.activateProfile(args)
|
||||
|
||||
// Update tab-specific API config name
|
||||
this.tabSpecificApiConfigName = name
|
||||
|
||||
// See `upsertProviderProfile` for a description of what this is doing.
|
||||
await Promise.all([
|
||||
this.contextProxy.setValue("listApiConfigMeta", await this.providerSettingsManager.listConfig()),
|
||||
|
|
@ -1334,8 +1340,9 @@ export class ClineProvider
|
|||
// Update list metadata globally (this is fine to share)
|
||||
await this.contextProxy.setValue("listApiConfigMeta", await this.providerSettingsManager.listConfig())
|
||||
|
||||
// Store provider settings in context for this tab's use
|
||||
// Note: We don't update global currentApiConfigName to avoid affecting other tabs
|
||||
// For backward compatibility, also update global currentApiConfigName
|
||||
await this.contextProxy.setValue("currentApiConfigName", name)
|
||||
await this.contextProxy.setProviderSettings(providerSettings)
|
||||
|
||||
const mode = this.tabSpecificMode || this.getGlobalState("mode") || defaultModeSlug
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue