Skip to content

Commit

Permalink
fix make all
Browse files Browse the repository at this point in the history
  • Loading branch information
luzhnyak committed Feb 18, 2024
1 parent 81ddd55 commit 4996cdc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/components/Filter/Filter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ const Filter = () => {
}

const handleSelectBrand = async (item) => {
if (!params.make && item === "All") {
return;
}

dispatch(resetCars());

if (item === "All") {
Expand Down
1 change: 0 additions & 1 deletion src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ img {

.body-scroll-lock {
overflow: hidden;
margin-right: 8px;
}

::-webkit-scrollbar {
Expand Down
6 changes: 1 addition & 5 deletions src/redux/cars/slice.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ const carsSlice = createSlice({
name: "cars",
initialState: carsInitialState,
reducers: {
resetPage(state) {
state.page = 1;
state.items = [];
},
incPage(state) {
state.page = state.page + 1;
},
Expand Down Expand Up @@ -47,5 +43,5 @@ const carsSlice = createSlice({
}),
});

export const { resetPage, incPage, resetCars } = carsSlice.actions;
export const { incPage, resetCars } = carsSlice.actions;
export const carsReducer = carsSlice.reducer;

0 comments on commit 4996cdc

Please sign in to comment.