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

Function initUser

src/utils/user.ts:57–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55 * This pre-fetches the email so getUser() can remain synchronous.
56 */
57export async function initUser(): Promise<void> {
58 if (cachedEmail === null && !emailFetchPromise) {
59 emailFetchPromise = getEmailAsync()
60 cachedEmail = await emailFetchPromise
61 emailFetchPromise = null
62 // Clear memoization cache so next call picks up the email
63 getCoreUserData.cache.clear?.()
64 }
65}
66
67/**
68 * Reset all user data caches. Call on auth changes (login/logout/account switch)

Callers 1

startDeferredPrefetchesFunction · 0.85

Calls 2

getEmailAsyncFunction · 0.85
clearMethod · 0.45

Tested by

no test coverage detected