File tree 1 file changed +4
-4
lines changed
instantsearch.js/render-state/src
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -32,11 +32,10 @@ const emptyHits = connectHits(({ hits, widgetParams }) => {
32
32
return ;
33
33
}
34
34
35
- const refinementListsUiState = search . getUiState ( ) [ indexName ] . refinementList ;
35
+ const brandState = search . renderState [ indexName ] . refinementList . brand ;
36
36
const isPearRefined =
37
- refinementListsUiState &&
38
- refinementListsUiState . brand &&
39
- refinementListsUiState . brand . includes ( 'Pear' ) ;
37
+ brandState . items . filter ( ( item ) => item . label === 'Pear' && item . isRefined )
38
+ . length > 0 ;
40
39
41
40
if ( ! isPearRefined ) {
42
41
container . innerHTML = 'No results' ;
@@ -83,6 +82,7 @@ search.addWidgets([
83
82
} ) ( refinementList ) ( {
84
83
container : '#brand' ,
85
84
attribute : 'brand' ,
85
+ sortBy : [ 'isRefined' ] ,
86
86
} ) ,
87
87
panel ( {
88
88
templates : {
You can’t perform that action at this time.
0 commit comments