Skip to content

Commit 6254e74

Browse files
committed
More fixes to checkbox state
1 parent 852ac53 commit 6254e74

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

.changeset/dull-gifts-rhyme.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+
Another fix to the auto approve menu

src/core/webview/ClineProvider.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
877877
await this.postStateToWebview()
878878
break
879879
case "autoApprovalEnabled":
880-
await this.updateGlobalState("autoApprovalEnabled", message.bool)
880+
await this.updateGlobalState("autoApprovalEnabled", message.bool ?? false)
881881
await this.postStateToWebview()
882882
break
883883
case "enhancePrompt":
@@ -1644,6 +1644,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
16441644
mode,
16451645
customPrompts,
16461646
enhancementApiConfigId,
1647+
autoApprovalEnabled,
16471648
} = await this.getState()
16481649

16491650
const allowedCommands = vscode.workspace
@@ -1683,6 +1684,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
16831684
mode: mode ?? codeMode,
16841685
customPrompts: customPrompts ?? {},
16851686
enhancementApiConfigId,
1687+
autoApprovalEnabled: autoApprovalEnabled ?? false,
16861688
}
16871689
}
16881690

@@ -1797,6 +1799,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
17971799
modeApiConfigs,
17981800
customPrompts,
17991801
enhancementApiConfigId,
1802+
autoApprovalEnabled,
18001803
] = await Promise.all([
18011804
this.getGlobalState("apiProvider") as Promise<ApiProvider | undefined>,
18021805
this.getGlobalState("apiModelId") as Promise<string | undefined>,
@@ -1856,6 +1859,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
18561859
this.getGlobalState("modeApiConfigs") as Promise<Record<Mode, string> | undefined>,
18571860
this.getGlobalState("customPrompts") as Promise<CustomPrompts | undefined>,
18581861
this.getGlobalState("enhancementApiConfigId") as Promise<string | undefined>,
1862+
this.getGlobalState("autoApprovalEnabled") as Promise<boolean | undefined>,
18591863
])
18601864

18611865
let apiProvider: ApiProvider
@@ -1959,6 +1963,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
19591963
modeApiConfigs: modeApiConfigs ?? {} as Record<Mode, string>,
19601964
customPrompts: customPrompts ?? {},
19611965
enhancementApiConfigId,
1966+
autoApprovalEnabled: autoApprovalEnabled ?? false,
19621967
}
19631968
}
19641969

webview-ui/src/context/ExtensionStateContext.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode
9393
mode: codeMode,
9494
customPrompts: defaultPrompts,
9595
enhancementApiConfigId: '',
96+
autoApprovalEnabled: false,
9697
})
9798
const [didHydrateState, setDidHydrateState] = useState(false)
9899
const [showWelcome, setShowWelcome] = useState(false)

0 commit comments

Comments
 (0)