From 956e174faaefc394f5f3531a8f05b3ca699a46e6 Mon Sep 17 00:00:00 2001 From: Chase Manning <chase@manning.dev> Date: Wed, 29 Nov 2023 13:28:29 +0000 Subject: [PATCH] :bug fix bug with using stones --- src/app/use-item-data.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/app/use-item-data.ts b/src/app/use-item-data.ts index 9986dee..542f490 100644 --- a/src/app/use-item-data.ts +++ b/src/app/use-item-data.ts @@ -635,7 +635,8 @@ const useItemData = () => { dispatch( showActionOnPokemon((index: number) => { - const evolveToId = EVOLUTIONS[index]; + const pokemonId = pokemon[index].id; + const evolveToId = EVOLUTIONS[pokemonId]; if (!evolveToId) return; dispatch( showEvolution({ @@ -667,7 +668,8 @@ const useItemData = () => { dispatch( showActionOnPokemon((index: number) => { - const evolveToId = EVOLUTIONS[index]; + const pokemonId = pokemon[index].id; + const evolveToId = EVOLUTIONS[pokemonId]; if (!evolveToId) return; dispatch( showEvolution({ @@ -699,7 +701,8 @@ const useItemData = () => { dispatch( showActionOnPokemon((index: number) => { - const evolveToId = EVOLUTIONS[index]; + const pokemonId = pokemon[index].id; + const evolveToId = EVOLUTIONS[pokemonId]; if (!evolveToId) return; dispatch( showEvolution({ @@ -732,7 +735,8 @@ const useItemData = () => { dispatch( showActionOnPokemon((index: number) => { - const evolveToId = EVOLUTIONS[index]; + const pokemonId = pokemon[index].id; + const evolveToId = EVOLUTIONS[pokemonId]; if (!evolveToId) return; dispatch( showEvolution({ @@ -763,7 +767,8 @@ const useItemData = () => { dispatch( showActionOnPokemon((index: number) => { - const evolveToId = EVOLUTIONS[index]; + const pokemonId = pokemon[index].id; + const evolveToId = EVOLUTIONS[pokemonId]; if (!evolveToId) return; dispatch( showEvolution({