()
| 88 | * Mark that the Grove notice has been viewed by the user |
| 89 | */ |
| 90 | export async function markGroveNoticeViewed(): Promise<void> { |
| 91 | try { |
| 92 | await withOAuth401Retry(() => { |
| 93 | const authHeaders = getAuthHeaders() |
| 94 | if (authHeaders.error) { |
| 95 | throw new Error(`Failed to get auth headers: ${authHeaders.error}`) |
| 96 | } |
| 97 | return axios.post( |
| 98 | `${getOauthConfig().BASE_API_URL}/api/oauth/account/grove_notice_viewed`, |
| 99 | {}, |
| 100 | { |
| 101 | headers: { |
| 102 | ...authHeaders.headers, |
| 103 | 'User-Agent': getClaudeCodeUserAgent(), |
| 104 | }, |
| 105 | }, |
| 106 | ) |
| 107 | }) |
| 108 | // This mutates grove_notice_viewed_at server-side — Grove.tsx:87 reads it |
| 109 | // to decide whether to show the dialog. Without invalidation a same-session |
| 110 | // remount would read stale viewed_at:null and re-show the dialog. |
| 111 | getGroveSettings.cache.clear?.() |
| 112 | } catch (err) { |
| 113 | logError(err) |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | /** |
| 118 | * Update Grove settings for the user account |
no test coverage detected