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

Function getAvatar

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

Source from the content-addressed store, hash-verified

139}
140
141export async function getAvatar(avatarId, displayName = null, isRefresh = false, {priority = FOREGROUND_PRIORITY} = {}) {
142 if (!avatarId || avatarId === '') {
143 return null;
144 }
145 if (!displayName) {
146 displayName = await getDisplayName(isRefresh, {priority});
147 }
148 if (!displayName) {
149 return null;
150 }
151 return loadCachedValue({
152 key: avatarCacheKey(displayName, avatarId),
153 legacyFields: ["avatar"],
154 forceRefresh: isRefresh,
155 priority,
156 load: () => apiText(GET_AVATAR, {
157 body: {avatar_id: avatarId},
158 fetchPriority: priority,
159 }),
160 });
161}
162
163export async function setAvatar(avatar, displayName = null, avatarId = null) {
164 if (!avatar) {

Callers 8

loaderFunction · 0.90
loaderFunction · 0.90
loaderFunction · 0.90
actionFunction · 0.90
loadApplicantProfileFunction · 0.90
refreshApplicantProfileFunction · 0.90
prefetchProfilesFunction · 0.90
toggleAnonymousFunction · 0.85

Calls 4

loadCachedValueFunction · 0.90
apiTextFunction · 0.90
getDisplayNameFunction · 0.85
avatarCacheKeyFunction · 0.85

Tested by

no test coverage detected