Fix episode name without metadata

This commit is contained in:
Zoe Roux 2023-01-08 01:46:33 +09:00
parent dad0a7d30a
commit bb4e7b7712
No known key found for this signature in database
GPG Key ID: B2AB52A2636E5C46
2 changed files with 12 additions and 11 deletions

View File

@ -44,16 +44,18 @@ export const EpisodeBox = ({
thumbnail,
isLoading,
...props
}: WithLoading<{
name: string;
overview: string;
thumbnail?: string | null;
}> &
Stylable) => {
}: Stylable &
WithLoading<{
name: string | null;
overview: string;
thumbnail?: string | null;
}>) => {
const { t } = useTranslation();
return (
<View {...props}>
<Image src={thumbnail} alt="" layout={{ width: percent(100), aspectRatio: 16 / 9 }} />
<Skeleton>{isLoading || <P>{name}</P>}</Skeleton>
<Skeleton>{isLoading || <P>{name ?? t("show.episodeNoMetadata")}</P>}</Skeleton>
<Skeleton>{isLoading || <P>{overview}</P>}</Skeleton>
</View>
);
@ -70,8 +72,8 @@ export const EpisodeLine = ({
}: WithLoading<{
slug: string;
displayNumber: string;
name: string;
overview: string;
name: string | null;
overview: string | null;
thumbnail?: string | null;
}> &
Stylable) => {

View File

@ -50,8 +50,7 @@ export const EpisodeList = ({
{(item) => (
<EpisodeLine
{...item}
isLoading={item.isLoading}
displayNumber={item.isLoading ? undefined : episodeDisplayNumber(item)}
displayNumber={item.isLoading ? undefined! : episodeDisplayNumber(item)!}
/>
)}
</InfiniteFetch>