Skip to content

Commit

Permalink
fix(videodetail): fix error before loading episode
Browse files Browse the repository at this point in the history
  • Loading branch information
royschut committed Jun 24, 2021
1 parent a476f7a commit 62406b8
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/screens/Series/Series.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,12 @@ const Series = ({
};
}, [play]);

if (isLoading || playlistIsLoading) return <LoadingOverlay />;
if (isLoading || playlistIsLoading || !searchParams.has('e')) return <LoadingOverlay />;
if (error || !item) return <ErrorPage title="Episode not found!" />;
if (playlistError || !seriesPlaylist) return <ErrorPage title="Series not found!" />;

const pageTitle = `${item.title} - ${config.siteName}`;
const canonicalUrl =
seriesPlaylist && item ? `${window.location.origin}${episodeURL(seriesPlaylist, item.mediaid)}` : window.location.href;
const canonicalUrl = seriesPlaylist && item ? `${window.location.origin}${episodeURL(seriesPlaylist, item.mediaid)}` : window.location.href;

return (
<React.Fragment>
Expand Down Expand Up @@ -159,14 +158,7 @@ const Series = ({
<div className={styles.episodes}>
<h3>{t('episodes')}</h3>
{filters.length > 1 && (
<Filter
name="categories"
value={seasonFilter}
valuePrefix="Season "
defaultLabel="All"
options={filters}
setValue={setSeasonFilter}
/>
<Filter name="categories" value={seasonFilter} valuePrefix="Season " defaultLabel="All" options={filters} setValue={setSeasonFilter} />
)}
</div>
<CardGrid
Expand Down

0 comments on commit 62406b8

Please sign in to comment.