File tree Expand file tree Collapse file tree 3 files changed +11
-15
lines changed Expand file tree Collapse file tree 3 files changed +11
-15
lines changed Original file line number Diff line number Diff line change 1515 "@algolia/autocomplete-theme-classic" : " 1.0.0" ,
1616 "@algolia/client-search" : " 4.9.1" ,
1717 "algoliasearch" : " 4.9.1" ,
18- "instantsearch.js" : " 4.21 .0" ,
18+ "instantsearch.js" : " 4.22 .0" ,
1919 "preact" : " 10.5.13"
2020 },
2121 "devDependencies" : {
Original file line number Diff line number Diff line change @@ -167,17 +167,13 @@ export const debouncedSetInstantSearchUiState = debounce(
167167
168168// Get the current category from InstantSearch.
169169export function getInstantSearchCurrentCategory ( ) {
170- const indexRenderState = search . renderState [ INSTANT_SEARCH_INDEX_NAME ] ;
171- const hierarchicalMenuUiState =
172- indexRenderState && indexRenderState . hierarchicalMenu ;
173- const categories =
174- ( hierarchicalMenuUiState &&
175- hierarchicalMenuUiState [ INSTANT_SEARCH_HIERARCHICAL_ATTRIBUTE ] &&
176- hierarchicalMenuUiState [ INSTANT_SEARCH_HIERARCHICAL_ATTRIBUTE ] . items ) ||
177- [ ] ;
178- const refinedCategory = categories . find ( ( category ) => category . isRefined ) ;
170+ const indexUiState = search . getUiState ( ) [ INSTANT_SEARCH_INDEX_NAME ] ;
171+ const hierarchicalMenuUiState = indexUiState && indexUiState . hierarchicalMenu ;
172+ const currentCategories =
173+ hierarchicalMenuUiState &&
174+ hierarchicalMenuUiState [ INSTANT_SEARCH_HIERARCHICAL_ATTRIBUTE ] ;
179175
180- return refinedCategory && refinedCategory . value ;
176+ return currentCategories && currentCategories [ 0 ] ;
181177}
182178
183179// Build URLs that InstantSearch understands.
Original file line number Diff line number Diff line change @@ -10535,10 +10535,10 @@ inquirer@^7.0.0:
1053510535 strip-ansi "^6.0.0"
1053610536 through "^2.3.6"
1053710537
10538- instantsearch.js@4.21 .0:
10539- version "4.21 .0"
10540- resolved "https://registry.yarnpkg.com/instantsearch.js/-/instantsearch.js-4.21 .0.tgz#3eec6b596795af7ec534d510fef58f36236a87e5 "
10541- integrity sha512-SgA7wRyicP8Uwdomp0dNQY9rWIjRSuTfyPgQ6GjRuYT7k8pfC7scHpC9CSfsTi6d0FTV18Psk+citFDRhXlffg ==
10538+ instantsearch.js@4.22 .0:
10539+ version "4.22 .0"
10540+ resolved "https://registry.yarnpkg.com/instantsearch.js/-/instantsearch.js-4.22 .0.tgz#d28c7a2be6b399736f8f2edd6f59d474a0f661a4 "
10541+ integrity sha512-IPjg/EwhDqFpvCJC1g3DF+i2cAr3SQZ9JPFhuKWC2apnGNfiFkPIQKvHx1pFTQm7FlZe262Xcpqi1ag1KVPGpA ==
1054210542 dependencies:
1054310543 "@types/googlemaps" "^3.39.6"
1054410544 algoliasearch-helper "^3.4.4"
You can’t perform that action at this time.
0 commit comments