MCPcopy
hub / github.com/codeaashu/claude-code / updateGroveSettings

Function updateGroveSettings

src/services/api/grove.ts:120–148  ·  view source on GitHub ↗
(
  groveEnabled: boolean,
)

Source from the content-addressed store, hash-verified

118 * Update Grove settings for the user account
119 */
120export async function updateGroveSettings(
121 groveEnabled: boolean,
122): Promise<void> {
123 try {
124 await withOAuth401Retry(() => {
125 const authHeaders = getAuthHeaders()
126 if (authHeaders.error) {
127 throw new Error(`Failed to get auth headers: ${authHeaders.error}`)
128 }
129 return axios.patch(
130 `${getOauthConfig().BASE_API_URL}/api/oauth/account/settings`,
131 {
132 grove_enabled: groveEnabled,
133 },
134 {
135 headers: {
136 ...authHeaders.headers,
137 'User-Agent': getClaudeCodeUserAgent(),
138 },
139 },
140 )
141 })
142 // Invalidate memoized settings so the post-toggle confirmation
143 // read in privacy-settings.tsx picks up the new value.
144 getGroveSettings.cache.clear?.()
145 } catch (err) {
146 logError(err)
147 }
148}
149
150/**
151 * Check if user is qualified for Grove (non-blocking, cache-first).

Callers 2

GroveDialogFunction · 0.85
PrivacySettingsDialogFunction · 0.85

Calls 7

withOAuth401RetryFunction · 0.85
getOauthConfigFunction · 0.85
getClaudeCodeUserAgentFunction · 0.85
patchMethod · 0.80
getAuthHeadersFunction · 0.50
logErrorFunction · 0.50
clearMethod · 0.45

Tested by

no test coverage detected