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 = (
139139 } )
140140 . filter ( ( brand ) => {
141141 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 )
143146 } )
144147 . map ( ( brand ) => capitalize ( brand ) )
145148
Original file line number Diff line number Diff line change @@ -35,16 +35,17 @@ export const useFilteredDeviceModels = ({
3535
3636 const query = useDeviceModels ( params )
3737
38- if ( brands === null ) {
39- return query
40- }
41-
4238 // UPSTREAM: The API does not have a brands or excludedBrands query parameter,
4339 // so selected brands are filtered here.
4440 return {
4541 ...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+ } ) ,
4950 }
5051}
You can’t perform that action at this time.
0 commit comments