From 1eb063c8be70f0871f85e0d4da9621dc48e47316 Mon Sep 17 00:00:00 2001 From: wraythex <59678213+wraythex@users.noreply.github.com> Date: Sat, 2 Sep 2023 12:38:36 -0500 Subject: [PATCH] Create fallbacks for missing data --- static/js/utils/utils.pokemon.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/static/js/utils/utils.pokemon.js b/static/js/utils/utils.pokemon.js index 68c675b00..7d1eb343f 100644 --- a/static/js/utils/utils.pokemon.js +++ b/static/js/utils/utils.pokemon.js @@ -150,15 +150,18 @@ function getPokemonGen(id) { } function getMoveName(id) { - return i18n(moveData[id].name) + const n = moveData[id].name + return i18n(n ? n : 'move_' + id) } function getMoveType(id) { - return i18n(moveData[id].type) + const n = moveData[id].type + return i18n(n ? n : 'move_type_' + id) } function getMoveTypeNoI8ln(id) { - return moveData[id].type + const n = moveData[id].type + return n ? n : 'move_type_' + id } function getPokemonRarity(pokemonId) {