File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed
src/lib/seam/components/SupportedDeviceTable Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -139,7 +139,10 @@ const useAvailableBrands = (
139
139
} )
140
140
. filter ( ( brand ) => {
141
141
if ( brands === null ) return true
142
- return brands . includes ( brand ) && ! excludedBrands . includes ( brand )
142
+ return brands . includes ( brand )
143
+ } )
144
+ . filter ( ( brand ) => {
145
+ return ! excludedBrands . includes ( brand )
143
146
} )
144
147
. map ( ( brand ) => capitalize ( brand ) )
145
148
Original file line number Diff line number Diff line change @@ -35,16 +35,17 @@ export const useFilteredDeviceModels = ({
35
35
36
36
const query = useDeviceModels ( params )
37
37
38
- if ( brands === null ) {
39
- return query
40
- }
41
-
42
38
// UPSTREAM: The API does not have a brands or excludedBrands query parameter,
43
39
// so selected brands are filtered here.
44
40
return {
45
41
...query ,
46
- deviceModels : query . deviceModels ?. filter (
47
- ( { brand } ) => brands . includes ( brand ) && ! excludedBrands . includes ( brand )
48
- ) ,
42
+ deviceModels : query . deviceModels
43
+ ?. filter ( ( { brand } ) => {
44
+ if ( brands === null ) return true
45
+ return brands . includes ( brand )
46
+ } )
47
+ . filter ( ( { brand } ) => {
48
+ return ! excludedBrands . includes ( brand )
49
+ } ) ,
49
50
}
50
51
}
You can’t perform that action at this time.
0 commit comments