MCPcopy Index your code
hub / github.com/anomalyco/opencode / toggleAccept

Function toggleAccept

packages/app/src/components/settings-general.tsx:104–120  ·  view source on GitHub ↗
(checked: boolean)

Source from the content-addressed store, hash-verified

102 })
103
104 const toggleAccept = (checked: boolean) => {
105 const value = dir()
106 if (!value) return
107
108 if (!params.id) {
109 if (permission.isAutoAcceptingDirectory(value) === checked) return
110 permission.toggleAutoAcceptDirectory(value)
111 return
112 }
113
114 if (checked) {
115 permission.enableAutoAccept(params.id, value)
116 return
117 }
118
119 permission.disableAutoAccept(params.id, value)
120 }
121 const desktop = createMemo(() => platform.platform === "desktop")
122
123 const themeOptions = createMemo<ThemeOption[]>(() => theme.ids().map((id) => ({ id, name: theme.name(id) })))

Callers

nothing calls this directly

Calls 1

dirFunction · 0.50

Tested by

no test coverage detected