social components inlay.at
atproto components sdui
86
fork

Configure Feed

Select the types of activity you want to include in your feed.

render blobs

+4 -7
+4 -7
proto/src/primitives.tsx
··· 37 37 if (src == null) return null; 38 38 if (typeof src === "string") return src; 39 39 if (typeof src === "object") { 40 - const blob = src as Record<string, unknown>; 41 - const ref = blob.ref as Record<string, unknown> | undefined; 42 - const cid = ref?.$link as string | undefined; 40 + const ref = (src as Record<string, unknown>).ref; 41 + const cid = ref != null ? String(ref) : undefined; 43 42 if (cid && did) { 44 43 const pds = await resolveDidToService(did); 45 44 return `${pds}/xrpc/com.atproto.sync.getBlob?did=${encodeURIComponent(did)}&cid=${encodeURIComponent(cid)}`; ··· 50 49 51 50 function resolveAvatarSrc(src: unknown, did?: string): string | null { 52 51 if (!did || src == null || typeof src !== "object") return null; 53 - const ref = (src as Record<string, unknown>).ref as 54 - | Record<string, unknown> 55 - | undefined; 56 - const cid = ref?.$link as string | undefined; 52 + const ref = (src as Record<string, unknown>).ref; 53 + const cid = ref != null ? String(ref) : undefined; 57 54 if (!cid) return null; 58 55 return `https://cdn.bsky.app/img/avatar_thumbnail/plain/${did}/${cid}@jpeg`; 59 56 }