From cd22b9453577774aea63d56efa0ab71616cb567c Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Thu, 6 Aug 2026 15:59:38 +0300 Subject: [PATCH] web/components/profile: show network vouches Signed-off-by: oppiliappan --- .../lib/components/profile/ProfileCard.svelte | 16 ++++++----- web/src/routes/[handle]/+layout.ts | 27 ++++++++++--------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/web/src/lib/components/profile/ProfileCard.svelte b/web/src/lib/components/profile/ProfileCard.svelte index 9472dcbdd..f57585acc 100644 --- a/web/src/lib/components/profile/ProfileCard.svelte +++ b/web/src/lib/components/profile/ProfileCard.svelte @@ -140,14 +140,16 @@ - {#if !isSelf} + {#if !isSelf || networkVouches.length > 0}
- + {#if !isSelf} + + {/if} {#if networkVouches.length > 0} {/if} diff --git a/web/src/routes/[handle]/+layout.ts b/web/src/routes/[handle]/+layout.ts index 6cdd35f5c..7dc10bc43 100644 --- a/web/src/routes/[handle]/+layout.ts +++ b/web/src/routes/[handle]/+layout.ts @@ -84,21 +84,22 @@ export const load: LayoutLoad = async (event) => { viewerDid && viewerDid !== did ? viewerUriOf(resolved.data, did, FOLLOWERS) : null; const viewerFollowRkey = viewerFollowUri ? rkeyFromUri(viewerFollowUri) : viewerFollowUri; - // vouches on this profile: the viewer's owndrives the button state) and the - // rest of the network + // vouches on this profile: the viewer's own (drives the button state) and the + // rest of the network. the network list shows for everyone, including on your + // own profile; the viewer's own vouch only matters when it isn't your profile. let viewerVouch: DirectVouch | null = null; let networkVouches: NetworkVouch[] = []; - if (did !== viewerDid) { - const [vouchPage, viewer] = await Promise.all([ - fetchVouchesPage(ctx, { did }).catch(() => null), - viewerDid ? getViewerVouch(ctx, viewerDid, did).catch(() => null) : Promise.resolve(null) - ]); - viewerVouch = viewer; - if (vouchPage) { - networkVouches = vouchPage.items - .filter((v) => v.direction === "incoming" && v.did !== viewerDid) - .map((v) => ({ did: v.did, handle: v.handle, kind: v.kind })); - } + const [vouchPage, viewer] = await Promise.all([ + fetchVouchesPage(ctx, { did }).catch(() => null), + viewerDid && did !== viewerDid + ? getViewerVouch(ctx, viewerDid, did).catch(() => null) + : Promise.resolve(null) + ]); + viewerVouch = viewer; + if (vouchPage) { + networkVouches = vouchPage.items + .filter((v) => v.direction === "incoming" && v.did !== viewerDid) + .map((v) => ({ did: v.did, handle: v.handle, kind: v.kind })); } const notJoined = !profile && Object.values(counts).every((n) => n === 0); -- 2.51.2