File tree Expand file tree Collapse file tree 1 file changed +9
-13
lines changed
src/connectors/infinite-hits Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -130,11 +130,16 @@ const connectInfiniteHits: InfiniteHitsConnector = (
130130 // if we only change pages.
131131 const {
132132 page = 0 ,
133+ facets,
133134 hierarchicalFacets,
134135 disjunctiveFacets,
136+ maxValuesPerFacet,
135137 ...currentState
136138 } = state ;
137139
140+ currentState . facetsRefinements = filterEmptyRefinements (
141+ currentState . facetsRefinements
142+ ) ;
138143 currentState . hierarchicalFacetsRefinements = filterEmptyRefinements (
139144 currentState . hierarchicalFacetsRefinements
140145 ) ;
@@ -242,20 +247,11 @@ const connectInfiniteHits: InfiniteHitsConnector = (
242247 ) ;
243248 }
244249
245- if ( ! hasShowPrevious ) {
246- return widgetSearchParameters ;
247- }
248-
249- if ( uiState . page ) {
250- // The page in the search parameters is decremented by one
251- // to get to the actual parameter value from the UI state.
252- return widgetSearchParameters . setQueryParameter (
253- 'page' ,
254- uiState . page - 1
255- ) ;
256- }
250+ // The page in the search parameters is decremented by one
251+ // to get to the actual parameter value from the UI state.
252+ const page = uiState . page ? uiState . page - 1 : 0 ;
257253
258- return widgetSearchParameters . setQueryParameter ( 'page' , 0 ) ;
254+ return widgetSearchParameters . setQueryParameter ( 'page' , page ) ;
259255 } ,
260256 } ;
261257 } ;
You can’t perform that action at this time.
0 commit comments