Skip to content

Commit

Permalink
Handle when images are null in the UI
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Apr 2, 2024
1 parent 3bec173 commit 53a2415
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion client/src/components/LoggedInLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ const Sidebar = () => {
pinned={false}
key={playlist.id}
playlist={playlist}
coverPhoto={<CoverPhoto image={thumbnail(playlist.images)} />}
coverPhoto={
<CoverPhoto image={thumbnail(playlist.images ?? [])} />
}
to={`/playlists/${playlist.id}`}
onMouseOverEdit={(playlist) =>
preloadPlaylistDetails({ id: playlist.id })
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/PlaylistDetailsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const PlaylistDetails = ({ queryRef }: PlaylistDetailsProps) => {
<Form form={form} className="flex gap-4">
<CoverPhoto
animateIn
image={playlist.images[0]}
image={(playlist.images ?? [])[0]}
className="row-span-2 flex-1"
/>
<div className="flex flex-col gap-4 flex-1">
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/PlaylistTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const PlaylistTile = ({ playlist }: PlaylistTileProps) => {
}
>
<MediaTile to={`/playlists/${playlist.id}`}>
<MediaTile.CoverPhoto image={playlist.images[0]} />
<MediaTile.CoverPhoto image={(playlist.images ?? [])[0]} />
<div className="flex flex-col">
<MediaTile.Title>{playlist.name}</MediaTile.Title>
<MediaTile.Details>
Expand Down

0 comments on commit 53a2415

Please sign in to comment.