MCPcopy Index your code
hub / github.com/OpenSIST/OpenSIST.github.io / setMetadata

Function setMetadata

src/Data/UserData.js:284–302  ·  view source on GitHub ↗
(metadata, displayName = null)

Source from the content-addressed store, hash-verified

282}
283
284export async function setMetadata(metadata, displayName = null) {
285 /*
286 * Set the user metadata to the local storage
287 * @param metadata [Object]: metadata
288 */
289 if (!metadata) {
290 return;
291 }
292 if (displayName === null) {
293 displayName = await getDisplayName();
294 }
295 if (!displayName) {
296 return;
297 }
298
299 const persistedMetadata = {...metadata};
300 delete persistedMetadata.latestYear;
301 await writeCacheValue(metadataCacheKey(displayName), persistedMetadata);
302}
303
304export async function getDisplayName(isRefresh = false, {priority = FOREGROUND_PRIORITY} = {}) {
305 return loadCachedValue({

Callers 6

setAvatarIDFunction · 0.85
toggleAnonymousFunction · 0.85
updateContactFunction · 0.85
collectProgramFunction · 0.85
uncollectProgramFunction · 0.85

Calls 3

writeCacheValueFunction · 0.90
getDisplayNameFunction · 0.85
metadataCacheKeyFunction · 0.85

Tested by

no test coverage detected