fix loading

This commit is contained in:
2026-01-18 21:37:00 +09:00
parent ce00222537
commit 623fe61468
9 changed files with 114 additions and 48 deletions

View File

@@ -1,13 +1,17 @@
import type { Profile } from '../types'
import { getAvatarUrl } from '../lib/api'
import { getAvatarUrl, getAvatarUrlRemote } from '../lib/api'
export async function renderProfile(
did: string,
profile: Profile,
handle: string,
webUrl?: string
webUrl?: string,
localOnly = false
): Promise<string> {
const avatarUrl = await getAvatarUrl(did, profile)
// Local mode: sync, no API call. Remote mode: async with API call
const avatarUrl = localOnly
? getAvatarUrl(did, profile, true)
: await getAvatarUrlRemote(did, profile)
const displayName = profile.value.displayName || handle || 'Unknown'
const description = profile.value.description || ''