Personal Site
0
fork

Configure Feed

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

Resolve the user's PDS.

This will be required to load the blobs for images, videos, subtitles, etc, as public.api.bsky.app does not support com.atproto.sync.getBlob

+19 -1
+19 -1
src/components/home/feeds/BskyPost.astro
··· 1 1 --- 2 + import { docResolver } from "./atproto"; 2 3 import { AppBskyFeedPost } from "@atcute/bluesky"; 3 4 4 5 export interface Author { ··· 12 13 post: AppBskyFeedPost.Main; 13 14 author: Author; 14 15 } 15 - --- 16 + 17 + const { post, author } = Astro.props; 18 + 19 + const understoodDid = ( 20 + did: `did:${string}:${string}`, 21 + ): did is `did:${"plc" | "web"}:${string}` => 22 + did.startsWith("did:web") || did.startsWith("did:plc"); 23 + // resolve the pds. bit hacky but should work 24 + const pds = await docResolver 25 + .resolve(understoodDid(author.did) ? author.did : "did:plc:failure") 26 + .then( 27 + (pds) => 28 + pds.service && 29 + pds.service.filter( 30 + (service) => service.type === "AtprotoPersonalDataServer", 31 + )[0].serviceEndpoint + "", 32 + ); 33 + ---