@@ -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
0 commit comments