Skip to content

Commit

Permalink
fix: when not images array is present, dont break the app
Browse files Browse the repository at this point in the history
  • Loading branch information
xiduzo committed Aug 24, 2024
1 parent c317d25 commit d9ccd16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/expo/src/components/shared/PlaylistListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const PlaylistListItem: FC<Props> = ({ playlist, ...props }) => {
{...props}
title={playlist.name}
subtitle={`${playlist.owner?.display_name}${playlist.tracks.total} songs`}
imageUri={playlist.images[0]?.url}
imageUri={playlist.images?.[0]?.url}
/>
);
};
Expand Down
6 changes: 3 additions & 3 deletions apps/expo/src/components/shared/TrackListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AnimationSpeed } from "@fissa/utils";
import { selectionAsync } from "expo-haptics";
import { memo, useCallback, useEffect, useRef, type FC } from "react";
import { Animated, Dimensions, type LayoutChangeEvent } from "react-native";
import { selectionAsync } from "expo-haptics";
import { AnimationSpeed } from "@fissa/utils";

import { ListItem, type ListItemProps } from "./ListItem";

Expand Down Expand Up @@ -49,7 +49,7 @@ export const TrackListItem: FC<Props> = memo(
{...props}
title={track.name}
subtitle={track.artists.map((artist) => artist.name).join(", ")}
imageUri={track.album.images[0]?.url}
imageUri={track.album.images?.[0]?.url}
/>
</Animated.View>
);
Expand Down

0 comments on commit d9ccd16

Please sign in to comment.