mirror of
https://github.com/romancm/gamebrary
synced 2024-11-23 11:43:07 +00:00
use optional chaining in age ratings getter
This commit is contained in:
parent
4148e45487
commit
8f1d9cc20b
1 changed files with 2 additions and 4 deletions
|
@ -59,11 +59,9 @@ export default {
|
|||
},
|
||||
|
||||
gameAgeRatings: () => (game) => {
|
||||
const ageRatings = game && game.age_ratings;
|
||||
if (!game?.age_ratings) return null;
|
||||
|
||||
if (!ageRatings) return null;
|
||||
|
||||
return ageRatings.map(({ category, rating }) => {
|
||||
return game?.age_ratings.map(({ category, rating }) => {
|
||||
const { name, ratings } = AGE_RATING_SYSTEMS.find(({ id }) => id === category);
|
||||
|
||||
return { name, rating: ratings[rating] };
|
||||
|
|
Loading…
Reference in a new issue