From 6d62bc2f9f19e0a03788d1c72cfa7da370349f97 Mon Sep 17 00:00:00 2001 From: Florian <45694132+flo-bit@users.noreply.github.com> Date: Tue, 3 Feb 2026 02:17:03 +0100 Subject: [PATCH] updated blentos redirect to custom domains --- src/lib/atproto/methods.ts | 4 +++- .../UpdatedBlentos/UpdatedBlentosCard.svelte | 11 ++++++++--- src/lib/website/CustomDomainModal.svelte | 2 ++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/lib/atproto/methods.ts b/src/lib/atproto/methods.ts index e44e3de..d955898 100644 --- a/src/lib/atproto/methods.ts +++ b/src/lib/atproto/methods.ts @@ -104,6 +104,7 @@ export async function getDetailedProfile(data?: { did?: Did; client?: Client }) export async function getBlentoOrBskyProfile(data: { did: Did; client?: Client }): Promise< Awaited> & { hasBlento: boolean; + url?: string; } > { let blentoProfile; @@ -127,7 +128,8 @@ export async function getBlentoOrBskyProfile(data: { did: Did; client?: Client } displayName: blentoProfile?.value?.name || response?.displayName || response?.handle, avatar: (getCDNImageBlobUrl({ did: data?.did, blob: blentoProfile?.value?.icon }) || response?.avatar) as `${string}:${string}`, - hasBlento: Boolean(blentoProfile.value) + hasBlento: Boolean(blentoProfile.value), + url: blentoProfile?.value?.url as string | undefined }; } diff --git a/src/lib/cards/SpecialCards/UpdatedBlentos/UpdatedBlentosCard.svelte b/src/lib/cards/SpecialCards/UpdatedBlentos/UpdatedBlentosCard.svelte index a63f3a8..ecc8f9e 100644 --- a/src/lib/cards/SpecialCards/UpdatedBlentos/UpdatedBlentosCard.svelte +++ b/src/lib/cards/SpecialCards/UpdatedBlentos/UpdatedBlentosCard.svelte @@ -6,12 +6,16 @@ let { item }: ContentComponentProps = $props(); + type ProfileWithUrl = AppBskyActorDefs.ProfileViewDetailed & { url?: string }; + const data = getAdditionalUserData(); // svelte-ignore state_referenced_locally - const profiles = data[item.cardType] as AppBskyActorDefs.ProfileViewDetailed[]; + const profiles = data[item.cardType] as ProfileWithUrl[]; - function getLink(profile: AppBskyActorDefs.ProfileViewDetailed): string { - if (profile.handle && profile.handle !== 'handle.invalid') { + function getLink(profile: ProfileWithUrl): string { + if (profile.url) { + return profile.url; + } else if (profile.handle && profile.handle !== 'handle.invalid') { return `/${profile.handle}`; } else { return `/${profile.did}`; @@ -26,6 +30,7 @@ href={getLink(profile)} class="bg-base-100 dark:bg-base-800 hover:bg-base-200 dark:hover:bg-base-700 accent:bg-accent-200/30 accent:hover:bg-accent-200/50 flex h-52 w-44 min-w-44 flex-col items-center justify-center gap-2 rounded-xl p-2 transition-colors duration-150" target="_blank" + rel={profile.url ? 'nofollow noopener noreferrer' : undefined} >
diff --git a/src/lib/website/CustomDomainModal.svelte b/src/lib/website/CustomDomainModal.svelte index 5fa0196..5f7d2b3 100644 --- a/src/lib/website/CustomDomainModal.svelte +++ b/src/lib/website/CustomDomainModal.svelte @@ -11,6 +11,7 @@ import { user } from '$lib/atproto'; import { Button, Input } from '@foxui/core'; import Modal from '$lib/components/modal/Modal.svelte'; + import { launchConfetti } from '@foxui/visual'; let step: 'input' | 'instructions' | 'verifying' | 'success' | 'error' = $state('input'); let domain = $state(''); @@ -55,6 +56,7 @@ const data = await res.json(); if (data.success) { + launchConfetti(); step = 'success'; } else if (data.error) { errorMessage = data.error; -- 2.51.2