Fixed setIsLoadingPokemons calling in fetchPokemonsInRegion
parent
c10c2f2608
commit
3926267d77
|
@ -19,6 +19,8 @@ export const fetchPokemonsInTheRegion = createAsyncThunk<
|
||||||
const { dispatch, getState } = thunkAPI;
|
const { dispatch, getState } = thunkAPI;
|
||||||
const regionOptions = getState().pokedex.regionOptions;
|
const regionOptions = getState().pokedex.regionOptions;
|
||||||
|
|
||||||
|
dispatch(setIsLoadingPokemons(true));
|
||||||
|
|
||||||
const { startId, endId } = getStartAndEndIdsForRegion(region, regionOptions);
|
const { startId, endId } = getStartAndEndIdsForRegion(region, regionOptions);
|
||||||
const pokemonIds = Array.from(
|
const pokemonIds = Array.from(
|
||||||
{ length: endId - startId + 1 },
|
{ length: endId - startId + 1 },
|
||||||
|
@ -114,6 +116,7 @@ export const {
|
||||||
setRegionOptions,
|
setRegionOptions,
|
||||||
setTypeOptions,
|
setTypeOptions,
|
||||||
setSortOptions,
|
setSortOptions,
|
||||||
|
setIsLoadingPokemons,
|
||||||
} = pokedexSlice.actions;
|
} = pokedexSlice.actions;
|
||||||
|
|
||||||
export default pokedexSlice.reducer;
|
export default pokedexSlice.reducer;
|
||||||
|
|
Loading…
Reference in New Issue