a tool for shared writing and social publishing
0

Configure Feed

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

guard profile data on page loads

Jared Pereira (Mar 30, 2026, 7:55 PM -0700) f1db7671 d5a3c4d7

+17 -9
+7 -2
app/api/rpc/[command]/get_profile_data.ts
··· 52 52 }); 53 53 } 54 54 55 - let profileReq = agent.app.bsky.actor.getProfile({ actor: did }); 55 + let profileReq = agent.app.bsky.actor 56 + .getProfile({ actor: did }) 57 + .then( 58 + (res) => res.data, 59 + () => undefined, 60 + ); 56 61 57 62 let publicationsReq = supabase 58 63 .from("publications") 59 64 .select("*") 60 65 .eq("identity_did", did); 61 66 62 - let [{ data: profile }, { data: rawPublications }] = await Promise.all([ 67 + let [profile, { data: rawPublications }] = await Promise.all([ 63 68 profileReq, 64 69 publicationsReq, 65 70 ]);
+1 -1
app/lish/[did]/[publication]/[rkey]/CanvasPage.tsx
··· 202 202 pageId: string | undefined; 203 203 isSubpage: boolean | undefined; 204 204 data: PostPageData; 205 - profile: ProfileViewDetailed; 205 + profile?: ProfileViewDetailed; 206 206 preferences: { 207 207 showComments?: boolean; 208 208 showMentions?: boolean;
+5 -2
app/lish/[did]/[publication]/[rkey]/DocumentPageRenderer.tsx
··· 46 46 47 47 let [document, profile] = await Promise.all([ 48 48 getPostPageData(did, rkey), 49 - agent.getProfile({ actor: did }), 49 + agent.getProfile({ actor: did }).then( 50 + (res) => res.data, 51 + () => undefined, 52 + ), 50 53 ]); 51 54 52 55 const record = document?.normalizedDocument; ··· 149 152 pubRecord?.preferences, 150 153 )} 151 154 pubRecord={pubRecord} 152 - profile={JSON.parse(JSON.stringify(profile.data))} 155 + profile={profile ? JSON.parse(JSON.stringify(profile)) : undefined} 153 156 document={document} 154 157 bskyPostData={JSON.parse(JSON.stringify(bskyPostData))} 155 158 did={did}
+1 -1
app/lish/[did]/[publication]/[rkey]/PostHeader/PostHeader.tsx
··· 17 17 18 18 export function PostHeader(props: { 19 19 data: PostPageData; 20 - profile: ProfileViewDetailed; 20 + profile?: ProfileViewDetailed; 21 21 preferences: { 22 22 showComments?: boolean; 23 23 showMentions?: boolean;
+2 -2
app/lish/[did]/[publication]/[rkey]/PostPages.tsx
··· 43 43 export type SharedPageProps = { 44 44 document: PostPageData; 45 45 did: string; 46 - profile: ProfileViewDetailed; 46 + profile?: ProfileViewDetailed; 47 47 preferences: { 48 48 showComments?: boolean; 49 49 showMentions?: boolean; ··· 104 104 }: { 105 105 document_uri: string; 106 106 document: PostPageData; 107 - profile: ProfileViewDetailed; 107 + profile?: ProfileViewDetailed; 108 108 pubRecord?: NormalizedPublication | null; 109 109 did: string; 110 110 prerenderedCodeBlocks?: Map<string, string>;
+1 -1
components/ProfilePopover.tsx
··· 58 58 > 59 59 {isLoading ? ( 60 60 <div className="text-secondary p-4">Loading...</div> 61 - ) : data ? ( 61 + ) : data?.profile ? ( 62 62 <div> 63 63 <ProfileHeader 64 64 profile={data.profile}