feat: 即使不存在歌曲元数据,也展示默认的“暂无封面”占位图片

This commit is contained in:
HouKunLin 2023-05-17 09:39:33 +08:00
parent 4341203c08
commit aaefffbb8b

View File

@ -18,6 +18,7 @@ import {
import { DecryptedAudioFile, deleteFile, ProcessState } from './fileListingSlice';
import { useCallback, useRef } from 'react';
import { useAppDispatch } from '~/hooks';
import coverSvgUrl from '~/assets/no-cover.svg';
interface FileRowProps {
id: string;
@ -83,14 +84,12 @@ export function FileRow({ id, file }: FileRowProps) {
>
<GridItem area="cover">
<Center w="160px" h="160px" m="auto">
{metadata && (
<Image
objectFit="cover"
src={metadata.cover}
alt={`"${metadata.album}" 的专辑封面`}
fallbackSrc={'/assets/no-cover.svg'}
src={metadata?.cover}
alt={`${metadata?.album} 的专辑封面`}
fallbackSrc={coverSvgUrl}
/>
)}
</Center>
</GridItem>
<GridItem area="title">