Skip to content

Commit

Permalink
fix question fetching (#710)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfauquette authored Aug 5, 2023
1 parent 5fe5659 commit 0cb514c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 13 deletions.
2 changes: 0 additions & 2 deletions src/components/welcome/Welcome.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,6 @@ const Welcome = (props) => {
[t, isDesktop, theme]
);

console.log({ steps });

return (
<>
<Tour
Expand Down
1 change: 0 additions & 1 deletion src/pages/packaging/useBuffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,5 @@ export const useBuffer = ({

const next = () =>
setData((prev) => (prev && prev.length > 0 ? prev.slice(1) : prev));
console.log(data);
return [data, next];
};
2 changes: 1 addition & 1 deletion src/pages/questions/QuestionFilter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ export const QuestionFilter = () => {
</TextField>

<FormControlLabel
value={innerSortByPopularity}
checked={innerSortByPopularity}
onChange={(event) =>
setInnerSortByPopularity(event.target.checked)
}
Expand Down
12 changes: 3 additions & 9 deletions src/pages/questions/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
} from "@reduxjs/toolkit";

import { IS_DEVELOPMENT_MODE } from "../../const";
import { DEFAULT_FILTER_STATE } from "../../components/QuestionFilter/const";
import robotoff from "../../robotoff";

import { sleep } from "../../utils";
Expand Down Expand Up @@ -44,14 +45,7 @@ export const questionBuffer = createSlice({
answeredQuestions: [],
fetchCompletted: false,
numberOfQuestionsAvailable: 0,
filterState: {
insightType: "brand",
brandFilter: "",
countryFilter: "",
sortByPopularity: false,
valueTag: "",
predictor: "",
},
filterState: DEFAULT_FILTER_STATE,
},
reducers: {
updateFilter: (state, action) => {
Expand Down Expand Up @@ -177,7 +171,7 @@ export const nbOfQuestionsInBufferSelector = createSelector(

export const nextPageSelector = createSelector(
getSubState,
(bufferState) => bufferState.remainingQuestions.length
(bufferState) => bufferState.page
);

export const currentQuestionSelector = createSelector(
Expand Down

0 comments on commit 0cb514c

Please sign in to comment.