Compare commits

...
Author SHA1 Message Date
celestial-vault 6c786a8caa pass partial state to webview 2025-08-01 18:46:00 -07:00
3 changed files with 4 additions and 3 deletions
+2 -2
View File
@@ -714,8 +714,8 @@ export class Controller {
return updatedTaskHistory
}
async postStateToWebview() {
const state = await this.getStateToPostToWebview()
async postStateToWebview(partialState?: Partial<ExtensionState>) {
const state = partialState || (await this.getStateToPostToWebview())
await sendStateUpdate(this.id, state)
}
@@ -33,7 +33,7 @@ export async function updateApiConfigurationProto(
}
// Post updated state to webview
await controller.postStateToWebview()
await controller.postStateToWebview({ apiConfiguration: appApiConfiguration })
return Empty.create()
} catch (error) {
@@ -266,6 +266,7 @@ export const ExtensionStateContextProvider: React.FC<{
const shouldUpdateAutoApproval = incomingVersion > currentVersion
const newState = {
...prevState,
...stateData,
autoApprovalSettings: shouldUpdateAutoApproval
? stateData.autoApprovalSettings