diff --git a/app/api/rpc/[command]/get_profile_data.ts b/app/api/rpc/[command]/get_profile_data.ts index f5a2216e..f1b40b8b 100644 --- a/app/api/rpc/[command]/get_profile_data.ts +++ b/app/api/rpc/[command]/get_profile_data.ts @@ -52,14 +52,19 @@ export const get_profile_data = makeRoute({ }); } - let profileReq = agent.app.bsky.actor.getProfile({ actor: did }); + let profileReq = agent.app.bsky.actor + .getProfile({ actor: did }) + .then( + (res) => res.data, + () => undefined, + ); let publicationsReq = supabase .from("publications") .select("*") .eq("identity_did", did); - let [{ data: profile }, { data: rawPublications }] = await Promise.all([ + let [profile, { data: rawPublications }] = await Promise.all([ profileReq, publicationsReq, ]); diff --git a/app/lish/[did]/[publication]/[rkey]/CanvasPage.tsx b/app/lish/[did]/[publication]/[rkey]/CanvasPage.tsx index 74e3763b..2b94be45 100644 --- a/app/lish/[did]/[publication]/[rkey]/CanvasPage.tsx +++ b/app/lish/[did]/[publication]/[rkey]/CanvasPage.tsx @@ -202,7 +202,7 @@ const CanvasMetadata = (props: { pageId: string | undefined; isSubpage: boolean | undefined; data: PostPageData; - profile: ProfileViewDetailed; + profile?: ProfileViewDetailed; preferences: { showComments?: boolean; showMentions?: boolean; diff --git a/app/lish/[did]/[publication]/[rkey]/DocumentPageRenderer.tsx b/app/lish/[did]/[publication]/[rkey]/DocumentPageRenderer.tsx index 6fe1314b..1f1c642c 100644 --- a/app/lish/[did]/[publication]/[rkey]/DocumentPageRenderer.tsx +++ b/app/lish/[did]/[publication]/[rkey]/DocumentPageRenderer.tsx @@ -46,7 +46,10 @@ export async function DocumentPageRenderer({ let [document, profile] = await Promise.all([ getPostPageData(did, rkey), - agent.getProfile({ actor: did }), + agent.getProfile({ actor: did }).then( + (res) => res.data, + () => undefined, + ), ]); const record = document?.normalizedDocument; @@ -149,7 +152,7 @@ export async function DocumentPageRenderer({ pubRecord?.preferences, )} pubRecord={pubRecord} - profile={JSON.parse(JSON.stringify(profile.data))} + profile={profile ? JSON.parse(JSON.stringify(profile)) : undefined} document={document} bskyPostData={JSON.parse(JSON.stringify(bskyPostData))} did={did} diff --git a/app/lish/[did]/[publication]/[rkey]/PostHeader/PostHeader.tsx b/app/lish/[did]/[publication]/[rkey]/PostHeader/PostHeader.tsx index d6d3da77..e74d216c 100644 --- a/app/lish/[did]/[publication]/[rkey]/PostHeader/PostHeader.tsx +++ b/app/lish/[did]/[publication]/[rkey]/PostHeader/PostHeader.tsx @@ -17,7 +17,7 @@ import { ProfilePopover } from "components/ProfilePopover"; export function PostHeader(props: { data: PostPageData; - profile: ProfileViewDetailed; + profile?: ProfileViewDetailed; preferences: { showComments?: boolean; showMentions?: boolean; diff --git a/app/lish/[did]/[publication]/[rkey]/PostPages.tsx b/app/lish/[did]/[publication]/[rkey]/PostPages.tsx index f622d03e..d678e484 100644 --- a/app/lish/[did]/[publication]/[rkey]/PostPages.tsx +++ b/app/lish/[did]/[publication]/[rkey]/PostPages.tsx @@ -43,7 +43,7 @@ export { getPageKey, useOpenPages, useInitializeOpenPages, openPage, closePage } export type SharedPageProps = { document: PostPageData; did: string; - profile: ProfileViewDetailed; + profile?: ProfileViewDetailed; preferences: { showComments?: boolean; showMentions?: boolean; @@ -104,7 +104,7 @@ export function PostPages({ }: { document_uri: string; document: PostPageData; - profile: ProfileViewDetailed; + profile?: ProfileViewDetailed; pubRecord?: NormalizedPublication | null; did: string; prerenderedCodeBlocks?: Map; diff --git a/components/ProfilePopover.tsx b/components/ProfilePopover.tsx index a6e28ff8..8c19163c 100644 --- a/components/ProfilePopover.tsx +++ b/components/ProfilePopover.tsx @@ -58,7 +58,7 @@ export const ProfilePopover = (props: { > {isLoading ? (
Loading...
- ) : data ? ( + ) : data?.profile ? (