From 87767474492fd208d87c3749d59e3180f7367e8c Mon Sep 17 00:00:00 2001 From: gunshiz Date: Sun, 16 Aug 2026 01:36:37 +0700 Subject: [PATCH] fix: refresh shared page author avatar --- app/share/[id]/page.tsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/share/[id]/page.tsx b/app/share/[id]/page.tsx index bde5b57..55695d1 100644 --- a/app/share/[id]/page.tsx +++ b/app/share/[id]/page.tsx @@ -12,7 +12,6 @@ import { DeleteShareButton, } from "@/app/share/[id]/share-client"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; -import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Card, @@ -32,6 +31,7 @@ import { Separator } from "@/components/ui/separator"; import { authOptions } from "@/lib/auth/auth-options"; import { getAdminDiscordIds, getSessionDiscordId } from "@/lib/auth/auth"; import { cdnUrl } from "@/lib/cdn-images"; +import { getDiscordMemberProfile } from "@/lib/discord/discord"; export const dynamic = "force-dynamic"; @@ -81,6 +81,11 @@ export default async function SharedTextPage({ .limit(1); if (!share) notFound(); + const authorProfile = await getDiscordMemberProfile( + share.authorDiscordId, + ); + const authorAvatarUrl = authorProfile?.avatarUrl || share.authorAvatarUrl; + const requestedSort = Array.isArray(query.comments) ? query.comments[0] : query.comments; @@ -118,11 +123,11 @@ export default async function SharedTextPage({
-
+
- {share.authorAvatarUrl && ( - + {authorAvatarUrl && ( + )} {initials(share.authorName)} @@ -131,13 +136,10 @@ export default async function SharedTextPage({ {share.authorName} - {formatBangkok(share.createdAt)} น. · เวลาไทย + {formatBangkok(share.createdAt)} น.
- - {share.source === "bot" ? "Discord bot" : "Web"} · {share.id} -
{(share.description || share.imageCdnId) && (