perf: improve avatar display timing for non-avatar user

This commit is contained in:
moonrailgun 2024-10-01 20:21:53 +08:00
parent b778f8c982
commit 04dc1e98dd
2 changed files with 1 additions and 2 deletions

View File

@ -76,7 +76,7 @@ export const UserConfig: React.FC<UserConfigProps> = React.memo((props) => {
<Avatar size={props.isCollapsed ? 'sm' : 'default'}> <Avatar size={props.isCollapsed ? 'sm' : 'default'}>
{userInfo?.avatar && <AvatarImage src={userInfo.avatar} />} {userInfo?.avatar && <AvatarImage src={userInfo.avatar} />}
<AvatarFallback> <AvatarFallback delayMs={userInfo?.avatar ? undefined : 0}>
{nickname.substring(0, 2).toUpperCase()} {nickname.substring(0, 2).toUpperCase()}
</AvatarFallback> </AvatarFallback>
</Avatar> </Avatar>

View File

@ -6,7 +6,6 @@ import { Loading } from '@/components/Loading';
import { NotFoundTip } from '@/components/NotFoundTip'; import { NotFoundTip } from '@/components/NotFoundTip';
import { Button } from '@/components/ui/button'; import { Button } from '@/components/ui/button';
import { ScrollArea, ScrollBar } from '@/components/ui/scroll-area'; import { ScrollArea, ScrollBar } from '@/components/ui/scroll-area';
import { Separator } from '@/components/ui/separator';
import { WebsiteCodeBtn } from '@/components/website/WebsiteCodeBtn'; import { WebsiteCodeBtn } from '@/components/website/WebsiteCodeBtn';
import { WebsiteLighthouseBtn } from '@/components/website/WebsiteLighthouseBtn'; import { WebsiteLighthouseBtn } from '@/components/website/WebsiteLighthouseBtn';
import { WebsiteMetricsTable } from '@/components/website/WebsiteMetricsTable'; import { WebsiteMetricsTable } from '@/components/website/WebsiteMetricsTable';