Full document, spreadsheet, slideshow, and diagram tooling
0
fork

Configure Feed

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

Merge pull request 'fix: fall back to public API when PDS profile fetch fails' (#28) from fix/profile-fallback-public-api into main

scott 190991b7 beedee1e

+11 -2
+11 -2
src/lib/auth.ts
··· 45 45 displayName = profile.data.displayName ?? handle; 46 46 avatar = profile.data.avatar ?? null; 47 47 } catch { 48 - handle = did; 49 - displayName = did; 48 + try { 49 + const res = await fetch(`https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?actor=${encodeURIComponent(did)}`); 50 + if (res.ok) { 51 + const data = await res.json(); 52 + handle = data.handle ?? did; 53 + displayName = data.displayName ?? handle; 54 + avatar = data.avatar ?? null; 55 + } 56 + } catch { 57 + // Both PDS and public API unavailable 58 + } 50 59 } 51 60 52 61 return {