Skip to content

Commit

Permalink
fix(ui): hide null dates in episodes list (#3035)
Browse files Browse the repository at this point in the history
  • Loading branch information
danshilm committed Sep 19, 2022
1 parent 16cb53f commit 7404d68
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/api/themoviedb/interfaces.ts
Expand Up @@ -191,7 +191,7 @@ export interface TmdbVideo {

export interface TmdbTvEpisodeResult {
id: number;
air_date: string;
air_date: string | null;
episode_number: number;
name: string;
overview: string;
Expand Down
2 changes: 1 addition & 1 deletion server/models/Tv.ts
Expand Up @@ -29,7 +29,7 @@ import type { Video } from './Movie';
interface Episode {
id: number;
name: string;
airDate: string;
airDate: string | null;
episodeNumber: number;
overview: string;
productionCode: string;
Expand Down
4 changes: 3 additions & 1 deletion src/components/TvDetails/Season/index.tsx
Expand Up @@ -41,7 +41,9 @@ const Season = ({ seasonNumber, tvId }: SeasonProps) => {
<div className="flex-1">
<div className="flex flex-col space-y-2 xl:flex-row xl:items-center xl:space-y-0 xl:space-x-2">
<h3 className="text-lg">{episode.name}</h3>
<AirDateBadge airDate={episode.airDate} />
{episode.airDate && (
<AirDateBadge airDate={episode.airDate} />
)}
</div>
{episode.overview && <p>{episode.overview}</p>}
</div>
Expand Down
1 change: 1 addition & 0 deletions src/components/TvDetails/index.tsx
Expand Up @@ -829,6 +829,7 @@ const TvDetails = ({ tv }: TvDetailsProps) => {
</div>
)}
{data.nextEpisodeToAir &&
data.nextEpisodeToAir.airDate &&
data.nextEpisodeToAir.airDate !== data.firstAirDate && (
<div className="media-fact">
<span>{intl.formatMessage(messages.nextAirDate)}</span>
Expand Down

0 comments on commit 7404d68

Please sign in to comment.