mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
gracefully handle software with no defined syntaxes
This commit is contained in:
parent
b44e7df2cf
commit
82f054087a
1 changed files with 6 additions and 3 deletions
|
|
@ -138,7 +138,10 @@ export const ListsTable = (props: RouteComponentProps & Props) => {
|
|||
sorter={(a, b) => {
|
||||
const getSoftwareIds = (l: List) =>
|
||||
software
|
||||
.filter((s: Software) => s.syntaxIds.includes(l.syntaxId))
|
||||
.filter(
|
||||
(s: Software) =>
|
||||
s.syntaxIds && s.syntaxIds.includes(l.syntaxId)
|
||||
)
|
||||
.map(s => s.id);
|
||||
return arraySorter(getSoftwareIds(a), getSoftwareIds(b), software);
|
||||
}}
|
||||
|
|
@ -169,8 +172,8 @@ export const ListsTable = (props: RouteComponentProps & Props) => {
|
|||
render={(syntaxId: number) =>
|
||||
syntaxId ? (
|
||||
<SoftwareCloud
|
||||
software={software.filter((s: Software) =>
|
||||
s.syntaxIds.includes(syntaxId)
|
||||
software={software.filter(
|
||||
(s: Software) => s.syntaxIds && s.syntaxIds.includes(syntaxId)
|
||||
)}
|
||||
/>
|
||||
) : null
|
||||
|
|
|
|||
Loading…
Reference in a new issue