Skip to content

Commit

Permalink
fix: feed icon fallback delay ms
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <[email protected]>
  • Loading branch information
Innei committed Nov 21, 2024
1 parent f84aa0b commit 89239d8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
20 changes: 11 additions & 9 deletions apps/renderer/src/modules/feed/feed-icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export function FeedIcon({
finalSrc = src

ImageElement = (
<PlatformIcon url={siteUrl} style={sizeStyle} className={cn("center mr-2", className)}>
<PlatformIcon url={siteUrl} style={sizeStyle} className={cn("center", className)}>
<m.img style={sizeStyle} {...(disableFadeIn ? {} : fadeInVariant)} />
</PlatformIcon>
)
Expand All @@ -174,7 +174,7 @@ export function FeedIcon({
height: size * 2,
})
ImageElement = (
<PlatformIcon url={image} style={sizeStyle} className={cn("center mr-2", className)}>
<PlatformIcon url={image} style={sizeStyle} className={cn("center", className)}>
<m.img
className={cn("mr-2", className)}
style={sizeStyle}
Expand All @@ -200,7 +200,7 @@ export function FeedIcon({
<PlatformIcon
url={(feed as FeedModel)?.siteUrl || fallbackUrl}
style={sizeStyle}
className={cn("center mr-2", className)}
className={cn("center", className)}
>
<FallbackableImage
className={cn("mr-2", className)}
Expand All @@ -212,15 +212,15 @@ export function FeedIcon({
break
}
case feed?.type === "inbox": {
ImageElement = <i className="i-mgc-inbox-cute-fi mr-2 shrink-0" style={sizeStyle} />
ImageElement = <i className="i-mgc-inbox-cute-fi shrink-0" style={sizeStyle} />
break
}
case !!feed?.title && !!feed.title[0]: {
ImageElement = fallbackIcon
break
}
default: {
ImageElement = <i className="i-mgc-link-cute-re mr-2 shrink-0" style={sizeStyle} />
ImageElement = <i className="i-mgc-link-cute-re shrink-0" style={sizeStyle} />
break
}
}
Expand All @@ -231,11 +231,13 @@ export function FeedIcon({

if (fallback && !!finalSrc) {
return (
<Avatar className="shrink-0">
<Avatar className="mr-2 shrink-0" style={sizeStyle}>
<AvatarImage className="rounded-sm object-cover" asChild src={finalSrc}>
{ImageElement}
</AvatarImage>
<AvatarFallback asChild>{fallbackIcon}</AvatarFallback>
<AvatarFallback delayMs={200} asChild>
{fallbackIcon}
</AvatarFallback>
</Avatar>
)
}
Expand All @@ -244,11 +246,11 @@ export function FeedIcon({
if (!finalSrc) return ImageElement
// Else
return (
<Avatar className="shrink-0">
<Avatar className="shrink-0" style={sizeStyle}>
<AvatarImage asChild src={finalSrc}>
{ImageElement}
</AvatarImage>
<AvatarFallback>
<AvatarFallback delayMs={200}>
<div className={cn("mr-2", className)} style={sizeStyle} data-placeholder={finalSrc} />
</AvatarFallback>
</Avatar>
Expand Down
7 changes: 0 additions & 7 deletions changelog/next.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@

## New Features

- Hold shift to quickly select multiple Feeds
- Collect entry from List

## Improvements

## Bug Fixes

- Action settings are invalid after loading archive entry
- Redundant parameter on the transform form
- Can't play normal video in video view

0 comments on commit 89239d8

Please sign in to comment.