making screenshots nullable

This commit is contained in:
Zamitto 2024-06-03 16:56:21 -03:00
parent 3da751a67b
commit 7ec082be23
2 changed files with 4 additions and 4 deletions

View File

@ -13,7 +13,7 @@ export function GallerySlider() {
const { t } = useTranslation("game_details");
const hasScreenshots = shopDetails && shopDetails.screenshots.length;
const hasScreenshots = shopDetails && shopDetails.screenshots?.length;
const hasMovies = shopDetails && shopDetails.movies?.length;
const mediaCount = useMemo(() => {
@ -77,7 +77,7 @@ export function GallerySlider() {
const previews = useMemo(() => {
const screenshotPreviews =
shopDetails?.screenshots.map(({ id, path_thumbnail }) => ({
shopDetails?.screenshots?.map(({ id, path_thumbnail }) => ({
id,
thumbnail: path_thumbnail,
})) ?? [];
@ -121,7 +121,7 @@ export function GallerySlider() {
))}
{hasScreenshots &&
shopDetails.screenshots.map((image, i) => (
shopDetails.screenshots?.map((image, i) => (
<img
key={image.id}
className={styles.gallerySliderMedia}

View File

@ -37,7 +37,7 @@ export interface SteamAppDetails {
publishers: string[];
genres: SteamGenre[];
movies?: SteamMovies[];
screenshots: SteamScreenshot[];
screenshots?: SteamScreenshot[];
pc_requirements: {
minimum: string;
recommended: string;