()
| 108 | * Mark that the Grove notice has been viewed by the user |
| 109 | */ |
| 110 | export async function markGroveNoticeViewed(): Promise<void> { |
| 111 | try { |
| 112 | await withOAuth401Retry(() => { |
| 113 | const authHeaders = getAuthHeaders() |
| 114 | if (authHeaders.error) { |
| 115 | throw new Error(`Failed to get auth headers: ${authHeaders.error}`) |
| 116 | } |
| 117 | return axios.post( |
| 118 | buildNoumenaPlatformUrl('/api/oauth/account/grove_notice_viewed'), |
| 119 | {}, |
| 120 | { |
| 121 | headers: { |
| 122 | ...authHeaders.headers, |
| 123 | 'User-Agent': getNcodeUserAgent(), |
| 124 | }, |
| 125 | }, |
| 126 | ) |
| 127 | }) |
| 128 | // This mutates grove_notice_viewed_at server-side — Grove.tsx:87 reads it |
| 129 | // to decide whether to show the dialog. Without invalidation a same-session |
| 130 | // remount would read stale viewed_at:null and re-show the dialog. |
| 131 | getGroveSettings.cache.clear?.() |
| 132 | } catch (err) { |
| 133 | logError(err) |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | /** |
| 138 | * Update Grove settings for the user account |
no test coverage detected