diff --git a/src/app/cases/page.tsx b/src/app/cases/page.tsx index 9c94d2ff..c31f329c 100644 --- a/src/app/cases/page.tsx +++ b/src/app/cases/page.tsx @@ -62,6 +62,7 @@ export default function Page() { .filter( c => languagesFilters.size === 0 || + c.languages.length === 0 || c.languages.find(l => languagesFilters.has(l)), ) .filter( @@ -85,6 +86,16 @@ export default function Page() { return boolToInt(aMissingRemote) - boolToInt(bMissingRemote); } + // if filtering languages + if (languagesFilters.size !== 0) { + const aMissingLanguages = a.languages.length === 0; + const bMissingLanguages = b.languages.length === 0; + if (aMissingLanguages || bMissingLanguages) + return ( + boolToInt(aMissingLanguages) - boolToInt(bMissingLanguages) + ); + } + // if filtering agency if (agencyFilters.size !== 0) { const aMissingAgency = nullOrUndefined(a.adjudicating_agency);