MCPcopy Create free account
hub / github.com/Noumena-Network/code / markGroveNoticeViewed

Function markGroveNoticeViewed

src/services/api/grove.ts:110–135  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

108 * Mark that the Grove notice has been viewed by the user
109 */
110export 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

Callers 2

checkGroveSettingsFunction · 0.85

Calls 6

withOAuth401RetryFunction · 0.85
buildNoumenaPlatformUrlFunction · 0.85
getNcodeUserAgentFunction · 0.85
getAuthHeadersFunction · 0.50
logErrorFunction · 0.50
clearMethod · 0.45

Tested by

no test coverage detected