mirror of
https://github.com/dergigi/boris.git
synced 2026-02-09 09:04:38 +01:00
fix: check loading state before resolved labels to show shimmer
- Check loading state FIRST before checking for resolved labels - Profiles have fallback labels immediately, which caused early return - Now loading shimmer will show even when fallback label exists - This fixes the issue where shimmer never appeared
This commit is contained in:
@@ -338,13 +338,7 @@ export function replaceNostrUrisInMarkdownWithProfileLabels(
|
||||
if (decoded.type === 'npub' || decoded.type === 'nprofile') {
|
||||
const pubkey = decoded.type === 'npub' ? decoded.data : decoded.data.pubkey
|
||||
|
||||
// Check if we have a resolved profile name using pubkey as key
|
||||
if (profileLabels.has(pubkey)) {
|
||||
const displayName = profileLabels.get(pubkey)!
|
||||
return `[${displayName}](${link})`
|
||||
}
|
||||
|
||||
// Check loading state using pubkey as key
|
||||
// Check loading state FIRST - show loading even if we have a fallback label
|
||||
const isLoading = profileLoading.get(pubkey)
|
||||
if (isLoading === true) {
|
||||
const label = getNostrUriLabel(encoded)
|
||||
@@ -352,6 +346,12 @@ export function replaceNostrUrisInMarkdownWithProfileLabels(
|
||||
// Wrap in span with profile-loading class for CSS styling
|
||||
return `[<span class="profile-loading">${label}</span>](${link})`
|
||||
}
|
||||
|
||||
// Check if we have a resolved profile name using pubkey as key
|
||||
if (profileLabels.has(pubkey)) {
|
||||
const displayName = profileLabels.get(pubkey)!
|
||||
return `[${displayName}](${link})`
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
// Ignore decode errors, fall through to default label
|
||||
|
||||
Reference in New Issue
Block a user