fix: steamGenres

This commit is contained in:
Zamitto 2024-12-31 19:32:41 -03:00
parent ad204e3879
commit 0661cbd661

View File

@ -31,11 +31,11 @@ export function GameItem({ game }: GameItemProps) {
const genres = useMemo(() => {
return game.genres?.map((genre) => {
const index = steamGenres["en"].findIndex(
const index = steamGenres["en"]?.findIndex(
(steamGenre) => steamGenre === genre
);
if (steamGenres[language] && steamGenres[language][index]) {
if (index && steamGenres[language] && steamGenres[language][index]) {
return steamGenres[language][index];
}