File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ const FieldCatalog = ({ fields }: { fields: Fields }) => {
2525 const categories = [
2626 ...new Set (
2727 fields
28- . map ( ( field ) => field . categories )
28+ . map ( ( field ) => field . categories ?? [ ] )
2929 . flat ( )
3030 . sort ( ) ,
3131 ) ,
@@ -61,13 +61,13 @@ const FieldCatalog = ({ fields }: { fields: Fields }) => {
6161 // On component load, check for deep-links to categories in the query param
6262 const params = new URLSearchParams ( window . location . search ) ;
6363 const categories = params . getAll ( "field-category" ) ;
64- const searchTerm = params . get ( "search-term" ) ;
64+ const searchTerm = params . get ( "search-term" ) ?? "" ;
6565
6666 if ( ! categories && ! searchTerm ) return ;
6767
6868 setFilters ( {
6969 ...filters ,
70- search : searchTerm ?? "" ,
70+ search : searchTerm ,
7171 categories : categories ,
7272 } ) ;
7373 } , [ ] ) ;
@@ -94,7 +94,7 @@ const FieldCatalog = ({ fields }: { fields: Fields }) => {
9494 type = "checkbox"
9595 className = "mr-2"
9696 value = { category }
97- checked = { filters . categories . includes ( category ?? "" ) }
97+ checked = { filters . categories . includes ( category ) }
9898 onClick = { ( e ) => {
9999 const target = e . target as HTMLInputElement ;
100100
You can’t perform that action at this time.
0 commit comments