diff --git a/core/config/ConfigHandler.ts b/core/config/ConfigHandler.ts index 1ac5dffde..2180ce0a1 100644 --- a/core/config/ConfigHandler.ts +++ b/core/config/ConfigHandler.ts @@ -197,7 +197,7 @@ export class ConfigHandler { async setSelectedProfile(profileId: string) { this.selectedProfileId = profileId; const newConfig = await this.loadConfig(); - this.notifyConfigListerners(newConfig); + this.notifyConfigListeners(newConfig); const selectedProfiles = this.globalContext.get("lastSelectedProfileForWorkspace") ?? {}; selectedProfiles[await this.getWorkspaceId()] = profileId; @@ -241,7 +241,7 @@ export class ConfigHandler { } } - private notifyConfigListerners(newConfig: ContinueConfig) { + private notifyConfigListeners(newConfig: ContinueConfig) { // Notify listeners that config changed for (const listener of this.updateListeners) { listener(newConfig); @@ -257,7 +257,7 @@ export class ConfigHandler { // TODO: this isn't right, there are two different senses in which you want to "reload" const newConfig = await this.currentProfile.reloadConfig(); this.inactiveProfiles.forEach((profile) => profile.clearConfig()); - this.notifyConfigListerners(newConfig); + this.notifyConfigListeners(newConfig); } getSerializedConfig(): Promise { diff --git a/gui/src/hooks/useSubmenuContextProviders.tsx b/gui/src/hooks/useSubmenuContextProviders.tsx index 45ee6f2c6..262b45eee 100644 --- a/gui/src/hooks/useSubmenuContextProviders.tsx +++ b/gui/src/hooks/useSubmenuContextProviders.tsx @@ -20,8 +20,6 @@ const MINISEARCH_OPTIONS = { const MAX_LENGTH = 70; function useSubmenuContextProviders() { - // TODO: Refresh periodically - const [minisearches, setMinisearches] = useState<{ [id: string]: MiniSearch; }>({}); @@ -228,6 +226,12 @@ function useSubmenuContextProviders() { }); }, [contextProviderDescriptions, loaded]); + useWebviewListener("configUpdate", async () => { + // When config is updated (for example switching to a different workspace) + // we need to reload the context providers. + setLoaded(false); + }); + return { getSubmenuContextItems, addItem,