✨ Refactor regional form check logic for improved readability and formatting consistency
This commit is contained in:
@@ -50,11 +50,14 @@ export function breakUpGamemaster(gamemaster) {
|
|||||||
// Add to pokemon (filtered - first occurrence OR regional forms)
|
// Add to pokemon (filtered - first occurrence OR regional forms)
|
||||||
// Check if this is a regional form by looking at the form string
|
// Check if this is a regional form by looking at the form string
|
||||||
const form = pokemonSettings?.form;
|
const form = pokemonSettings?.form;
|
||||||
const isRegionalForm = form ? regionCheck.includes(
|
const isRegionalForm = form
|
||||||
form.split('_')[1]?.toLowerCase()
|
? regionCheck.includes(form.split('_')[1]?.toLowerCase())
|
||||||
) : false;
|
: false;
|
||||||
|
|
||||||
if (!acc.pokemonSeen.has(pokemonId) || (acc.pokemonSeen.has(pokemonId) && isRegionalForm)) {
|
if (
|
||||||
|
!acc.pokemonSeen.has(pokemonId) ||
|
||||||
|
(acc.pokemonSeen.has(pokemonId) && isRegionalForm)
|
||||||
|
) {
|
||||||
acc.pokemonSeen.add(pokemonId);
|
acc.pokemonSeen.add(pokemonId);
|
||||||
acc.pokemon.push(item);
|
acc.pokemon.push(item);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user