MCPcopy Create free account
hub / github.com/OpenSIST/OpenSIST.github.io / setAvatar

Function setAvatar

src/Data/UserData.js:163–177  ·  view source on GitHub ↗
(avatar, displayName = null, avatarId = null)

Source from the content-addressed store, hash-verified

161}
162
163export async function setAvatar(avatar, displayName = null, avatarId = null) {
164 if (!avatar) {
165 return
166 }
167 if (!displayName) {
168 displayName = await getDisplayName();
169 }
170 if (!avatarId) {
171 avatarId = (await getMetadata(displayName))?.Avatar;
172 }
173 if (!displayName || !avatarId) {
174 return;
175 }
176 await writeCacheValue(avatarCacheKey(displayName, avatarId), avatar);
177}
178
179/**
180 * Get applicant metadata

Callers 2

uploadAvatarFunction · 0.85
toggleAnonymousFunction · 0.85

Calls 4

writeCacheValueFunction · 0.90
getDisplayNameFunction · 0.85
getMetadataFunction · 0.85
avatarCacheKeyFunction · 0.85

Tested by

no test coverage detected