Skip to content

Commit 317fbc1

Browse files
committed
Logic simplification
1 parent fa5f8e7 commit 317fbc1

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

src/activate/registerCommands.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -225,21 +225,9 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt
225225
const visibleProvider = getVisibleProviderOrLog(outputChannel)
226226

227227
if (!visibleProvider) {
228-
// If no visible provider, try to get the global state directly
229-
const currentState = context.globalState.get<boolean>("autoApprovalEnabled") ?? false
230-
const newState = !currentState
231-
await context.globalState.update("autoApprovalEnabled", newState)
232228
return
233229
}
234230

235-
// Toggle the auto-approval state
236-
const currentState = visibleProvider.getValue("autoApprovalEnabled") ?? false
237-
const newState = !currentState
238-
239-
// Update the state
240-
await visibleProvider.setValue("autoApprovalEnabled", newState)
241-
242-
// Post message to webview to update UI
243231
visibleProvider.postMessageToWebview({
244232
type: "action",
245233
action: "toggleAutoApprove",

0 commit comments

Comments
 (0)