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

Function getMetadata

src/Data/UserData.js:185–199  ·  view source on GitHub ↗
(displayName = null, isRefresh = false, {priority = FOREGROUND_PRIORITY} = {})

Source from the content-addressed store, hash-verified

183 * @returns {Promise<object>} - A promise resolving to metadata with Avatar and latestYear
184 */
185export async function getMetadata(displayName = null, isRefresh = false, {priority = FOREGROUND_PRIORITY} = {}) {
186 /*
187 * Get the user metadata from the server or local storage
188 * @param isRefresh [Boolean]: whether to refresh the data
189 * @return: metadata
190 */
191 if (!displayName) {
192 displayName = await getDisplayName(isRefresh, {priority});
193 }
194 if (!displayName) {
195 return null;
196 }
197 const metadata = await getMetadataBatch([displayName], isRefresh, {priority});
198 return metadata[displayName] ?? metadataWithLatestYear({});
199}
200
201export async function getMetadataBatch(displayNames, isRefresh = false, {priority = FOREGROUND_PRIORITY} = {}) {
202 const uniqueDisplayNames = [...new Set(displayNames)].filter(Boolean);

Callers 15

loaderFunction · 0.90
loaderFunction · 0.90
loaderFunction · 0.90
loaderFunction · 0.90
loaderFunction · 0.90
loaderFunction · 0.90
actionFunction · 0.90
loadApplicantProfileFunction · 0.90
refreshApplicantProfileFunction · 0.90
loaderFunction · 0.90

Calls 3

getDisplayNameFunction · 0.85
getMetadataBatchFunction · 0.85
metadataWithLatestYearFunction · 0.85

Tested by

no test coverage detected