a tool for shared writing and social publishing
0
fork

Configure Feed

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

resolve id w/ id resolver instead of xrpc call

+4 -4
+4 -4
app/lish/subscribeToPublication.ts
··· 11 11 import { redirect } from "next/navigation"; 12 12 import { encodeActionToSearchParam } from "app/api/oauth/[route]/afterSignInActions"; 13 13 import { Json } from "supabase/database.types"; 14 + import { IdResolver } from "@atproto/identity"; 14 15 15 16 let leafletFeedURI = 16 17 "at://did:plc:btxrwcaeyodrap5mnjw2fvmz/app.bsky.feed.generator/subscribedPublications"; 18 + let idResolver = new IdResolver(); 17 19 export async function subscribeToPublication( 18 20 publication: string, 19 21 redirectRoute?: string, ··· 51 53 repo: credentialSession.did!, 52 54 rkey: "self", 53 55 }), 54 - bsky.com.atproto.identity.resolveIdentity({ 55 - identifier: credentialSession.did!, 56 - }), 56 + idResolver.did.resolve(credentialSession.did!), 57 57 ]); 58 58 if (!identity.bsky_profiles && profile.value) { 59 59 await supabaseServerClient.from("bsky_profiles").insert({ 60 60 did: identity.atp_did, 61 61 record: profile.value as Json, 62 - handle: resolveDid.data.handle, 62 + handle: resolveDid?.alsoKnownAs?.[0], 63 63 }); 64 64 } 65 65 let savedFeeds = prefs.data.preferences.find(