Fixed setIsLoadingPokemons calling in fetchPokemonsInRegion

develop
Jason Zhu 2023-04-17 19:13:28 +10:00
parent c10c2f2608
commit 3926267d77
1 changed files with 3 additions and 0 deletions

View File

@ -19,6 +19,8 @@ export const fetchPokemonsInTheRegion = createAsyncThunk<
const { dispatch, getState } = thunkAPI;
const regionOptions = getState().pokedex.regionOptions;
dispatch(setIsLoadingPokemons(true));
const { startId, endId } = getStartAndEndIdsForRegion(region, regionOptions);
const pokemonIds = Array.from(
{ length: endId - startId + 1 },
@ -114,6 +116,7 @@ export const {
setRegionOptions,
setTypeOptions,
setSortOptions,
setIsLoadingPokemons,
} = pokedexSlice.actions;
export default pokedexSlice.reducer;