From b685dc5d29141087c991bf022970beb27c8c079f Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 23 Jan 2025 12:22:26 -0800 Subject: follows --- src/components/Media.svelte | 4 +-- .../(app)/[username]/(profile)/+layout.server.ts | 16 ++++----- .../(app)/[username]/(profile)/+layout.svelte | 38 +++++++++++----------- .../[username]/(profile)/followers/+page.svelte | 6 ++-- .../[username]/(profile)/follows/+page.server.js | 3 +- 5 files changed, 34 insertions(+), 33 deletions(-) diff --git a/src/components/Media.svelte b/src/components/Media.svelte index aff4cf39..c2a79a2b 100644 --- a/src/components/Media.svelte +++ b/src/components/Media.svelte @@ -20,8 +20,8 @@ {value.url.replace(/https?:\/\/(www\.)?/, "")} {:else} - - {value.url.replace(/https?:\/\/(www\.)?/, "")} + + link {/if} diff --git a/src/routes/(app)/[username]/(profile)/+layout.server.ts b/src/routes/(app)/[username]/(profile)/+layout.server.ts index 8600039e..d714ce76 100644 --- a/src/routes/(app)/[username]/(profile)/+layout.server.ts +++ b/src/routes/(app)/[username]/(profile)/+layout.server.ts @@ -7,17 +7,15 @@ export async function load({ depends, parent }) { const rates = await getRates(); const { subject, user } = await parent(); - // const { follows, followers } = await get(`/${subject.pubkey}/count`); + const { follows, followers } = await get(`/${subject.pubkey}/count`); let followList = new Promise((r) => r([])); - // if (user) - // followList = get(`/${user.pubkey}/follows?pubkeysOnly=true`).catch( - // () => [], - // ); - // + if (user) + followList = get(`/${user.pubkey}/follows?pubkeysOnly=true`).catch( + () => [], + ); - const follows = []; - const followers = []; - // const followList = []; + // const follows = []; + // const followers = []; return { follows, followers, followList, rate: rates[subject.currency] }; } diff --git a/src/routes/(app)/[username]/(profile)/+layout.svelte b/src/routes/(app)/[username]/(profile)/+layout.svelte index a219a487..9536d330 100644 --- a/src/routes/(app)/[username]/(profile)/+layout.svelte +++ b/src/routes/(app)/[username]/(profile)/+layout.svelte @@ -125,7 +125,7 @@ - + @@ -149,24 +149,24 @@ {/if} - - - - - - - - - - - - - - - - - - +
+ +
{#if showDetails}
diff --git a/src/routes/(app)/[username]/(profile)/followers/+page.svelte b/src/routes/(app)/[username]/(profile)/followers/+page.svelte index 62f05a0a..28b4c6f0 100644 --- a/src/routes/(app)/[username]/(profile)/followers/+page.svelte +++ b/src/routes/(app)/[username]/(profile)/followers/+page.svelte @@ -39,8 +39,10 @@
-
{data.display || ""}
-
@{data.username}
+
{data.display || data.display_name || ""}
+
+ @{data.username || data.name} +
diff --git a/src/routes/(app)/[username]/(profile)/follows/+page.server.js b/src/routes/(app)/[username]/(profile)/follows/+page.server.js index 9fbe37a3..946f2c1f 100644 --- a/src/routes/(app)/[username]/(profile)/follows/+page.server.js +++ b/src/routes/(app)/[username]/(profile)/follows/+page.server.js @@ -3,6 +3,7 @@ import { get } from "$lib/utils"; export async function load({ depends, parent }) { depends("app:user"); const { subject } = await parent(); - const follows = get(`/${subject.pubkey}/follows`).catch(() => []); + const follows = await get(`/${subject.pubkey}/follows`); + return { follows }; } -- cgit v1.2.3