From 5a6287ad5bb9d15e34b5e9b27095bde65de8171f Mon Sep 17 00:00:00 2001 From: David Leuliette Date: Wed, 23 Sep 2026 21:10:20 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20hide=20podcast=20platform?= =?UTF-8?q?=20buttons=20when=20the=20episode=20has=20no=20URL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Spotify and Apple Podcast buttons rendered even when an episode had an empty URL, so clicking them did nothing. Render each button only when its URL is set, hide the "Écouter l'épisode" card when neither exists, and show transcript timecodes as plain text when there is no Spotify URL. Co-Authored-By: Claude Fable 5.1 --- apps/web/components/podcast-episode-card.tsx | 52 +++++++++-------- apps/web/components/transcript-entry.tsx | 14 +++-- apps/web/pages/podcast/[slug].tsx | 60 +++++++++++--------- 3 files changed, 72 insertions(+), 54 deletions(-) diff --git a/apps/web/components/podcast-episode-card.tsx b/apps/web/components/podcast-episode-card.tsx index 8a920799..e5547492 100644 --- a/apps/web/components/podcast-episode-card.tsx +++ b/apps/web/components/podcast-episode-card.tsx @@ -40,30 +40,36 @@ export function PodcastEpisodeCard({ episode }: PodcastEpisodeCardProps) { -
-
- - + {(episode.spotify_url || episode.apple_podcast_url) && ( +
+
+ {episode.spotify_url && ( + + )} + {episode.apple_podcast_url && ( + + )} +
-
+ )} ); } diff --git a/apps/web/components/transcript-entry.tsx b/apps/web/components/transcript-entry.tsx index 8147046f..693698fd 100644 --- a/apps/web/components/transcript-entry.tsx +++ b/apps/web/components/transcript-entry.tsx @@ -10,16 +10,22 @@ export function TranscriptEntry({ spotify_url?: string; }) { const seconds = timecodeToSeconds(entry.time); - const spotifyUrl = `${spotify_url}${spotify_url?.includes('?') ? '&' : '?'}t=${seconds}`; + const spotifyUrl = spotify_url + ? `${spotify_url}${spotify_url.includes('?') ? '&' : '?'}t=${seconds}` + : undefined; return (
{entry.speaker} - - - {entry.time} - + {spotifyUrl ? ( + + {entry.time} + + ) : ( + {entry.time} + )}

{entry.text} diff --git a/apps/web/pages/podcast/[slug].tsx b/apps/web/pages/podcast/[slug].tsx index 995783d8..d0d21e75 100644 --- a/apps/web/pages/podcast/[slug].tsx +++ b/apps/web/pages/podcast/[slug].tsx @@ -196,34 +196,40 @@ export default function PodcastEpisodePage({ /> )}

- - - Écouter l'épisode - -
- + {(episode.spotify_url || episode.apple_podcast_url) && ( + + + Écouter l'épisode + +
+ {episode.spotify_url && ( + + )} - -
-
+ {episode.apple_podcast_url && ( + + )} +
+
+ )} {episode.youtube_embed_id && (