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

View File

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