fix: show Bluesky handle instead of Anonymous when author name is missing

This commit is contained in:
svemagie
2026-03-14 10:23:55 +01:00
parent 03d1354ea0
commit 92e5120891
+2 -2
View File
@@ -224,7 +224,7 @@ permalink: /interactions/
<a :href="wm.author?.url || '#'" target="_blank" rel="noopener" class="flex-shrink-0"> <a :href="wm.author?.url || '#'" target="_blank" rel="noopener" class="flex-shrink-0">
<img <img
:src="wm.author?.photo || '/images/default-avatar.svg'" :src="wm.author?.photo || '/images/default-avatar.svg'"
:alt="wm.author?.name || 'Anonymous'" :alt="wm.author?.name || (wm.author?.url?.includes('bsky.app/profile/') ? wm.author.url.split('/profile/')[1].split('/')[0] : 'Anonymous')"
class="w-10 h-10 rounded-full" class="w-10 h-10 rounded-full"
loading="lazy" loading="lazy"
onerror="this.src='/images/default-avatar.svg'" onerror="this.src='/images/default-avatar.svg'"
@@ -234,7 +234,7 @@ permalink: /interactions/
<div class="flex-1 min-w-0"> <div class="flex-1 min-w-0">
{# Header with author, type badge, and date #} {# Header with author, type badge, and date #}
<div class="flex flex-wrap items-center gap-2 mb-1"> <div class="flex flex-wrap items-center gap-2 mb-1">
<a :href="wm.author?.url || '#'" target="_blank" rel="noopener" class="font-semibold text-surface-900 dark:text-surface-100 hover:underline" x-text="wm.author?.name || 'Anonymous'"></a> <a :href="wm.author?.url || '#'" target="_blank" rel="noopener" class="font-semibold text-surface-900 dark:text-surface-100 hover:underline" x-text="wm.author?.name || (wm.author?.url?.includes('bsky.app/profile/') ? wm.author.url.split('/profile/')[1].split('/')[0] : 'Anonymous')"></a>
{# Type badge #} {# Type badge #}
<span x-show="wm['wm-property'] === 'like-of'" class="inline-flex items-center gap-1 px-2 py-0.5 text-xs bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300 rounded-full"> <span x-show="wm['wm-property'] === 'like-of'" class="inline-flex items-center gap-1 px-2 py-0.5 text-xs bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300 rounded-full">