Skip to content

Commit a6ed5ce

Browse files
Update the webview when changing settings via the API (#2143)
* Update the webview when changing settings via the API * Update src/exports/api.ts Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --------- Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
1 parent 73fe581 commit a6ed5ce

File tree

4 files changed

+6
-34
lines changed

4 files changed

+6
-34
lines changed

.changeset/grumpy-pets-run.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"roo-cline": patch
3+
---
4+
5+
Update the webview when changing settings via the API

src/exports/api.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,9 @@ export class API extends EventEmitter<RooCodeEvents> implements RooCodeAPI {
8282
return this.provider.getValues()
8383
}
8484

85-
public getConfigurationValue<K extends keyof RooCodeSettings>(key: K) {
86-
return this.provider.getValue(key)
87-
}
88-
8985
public async setConfiguration(values: RooCodeSettings) {
9086
await this.provider.setValues(values)
91-
}
92-
93-
public async setConfigurationValue<K extends keyof RooCodeSettings>(key: K, value: RooCodeSettings[K]) {
94-
await this.provider.setValue(key, value)
87+
await this.provider.postStateToWebview()
9588
}
9689

9790
public isReady() {

src/exports/interface.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -67,26 +67,12 @@ export interface RooCodeAPI extends EventEmitter<RooCodeEvents> {
6767
*/
6868
getConfiguration(): RooCodeSettings
6969

70-
/**
71-
* Returns the value of a configuration key.
72-
* @param key The key of the configuration value to return.
73-
* @returns The value of the configuration key.
74-
*/
75-
getConfigurationValue<K extends keyof RooCodeSettings>(key: K): RooCodeSettings[K]
76-
7770
/**
7871
* Sets the configuration for the current task.
7972
* @param values An object containing key-value pairs to set.
8073
*/
8174
setConfiguration(values: RooCodeSettings): Promise<void>
8275

83-
/**
84-
* Sets the value of a configuration key.
85-
* @param key The key of the configuration value to set.
86-
* @param value The value to set.
87-
*/
88-
setConfigurationValue<K extends keyof RooCodeSettings>(key: K, value: RooCodeSettings[K]): Promise<void>
89-
9076
/**
9177
* Returns true if the API is ready to use.
9278
*/

src/exports/roo-code.d.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -457,23 +457,11 @@ interface RooCodeAPI extends EventEmitter<RooCodeEvents> {
457457
* @returns The current configuration.
458458
*/
459459
getConfiguration(): RooCodeSettings
460-
/**
461-
* Returns the value of a configuration key.
462-
* @param key The key of the configuration value to return.
463-
* @returns The value of the configuration key.
464-
*/
465-
getConfigurationValue<K extends keyof RooCodeSettings>(key: K): RooCodeSettings[K]
466460
/**
467461
* Sets the configuration for the current task.
468462
* @param values An object containing key-value pairs to set.
469463
*/
470464
setConfiguration(values: RooCodeSettings): Promise<void>
471-
/**
472-
* Sets the value of a configuration key.
473-
* @param key The key of the configuration value to set.
474-
* @param value The value to set.
475-
*/
476-
setConfigurationValue<K extends keyof RooCodeSettings>(key: K, value: RooCodeSettings[K]): Promise<void>
477465
/**
478466
* Returns true if the API is ready to use.
479467
*/

0 commit comments

Comments
 (0)