mirror of
https://github.com/Steffo99/sophon.git
synced 2024-12-22 06:44:21 +00:00
🐛 Use Boolean
to filter the resources array
This commit is contained in:
parent
95b28eaa21
commit
38a9b8baef
3 changed files with 3 additions and 3 deletions
|
@ -21,7 +21,7 @@ export function GroupListBox({viewSet}: GroupListBoxProps): JSX.Element {
|
||||||
if(viewSet.resources.length === 0) {
|
if(viewSet.resources.length === 0) {
|
||||||
return <Empty>This Sophon instance has no groups.</Empty>
|
return <Empty>This Sophon instance has no groups.</Empty>
|
||||||
}
|
}
|
||||||
return viewSet.resources?.filter(res => res !== undefined).map(res => <GroupResourcePanel resource={res} key={res.value?.slug}/>)
|
return viewSet.resources?.filter(res => Boolean(res)).map(res => <GroupResourcePanel resource={res} key={res.value?.slug}/>)
|
||||||
},
|
},
|
||||||
[viewSet],
|
[viewSet],
|
||||||
)
|
)
|
||||||
|
|
|
@ -21,7 +21,7 @@ export function NotebookListBox({viewSet}: NotebookListBoxProps): JSX.Element {
|
||||||
if(viewSet.resources.length === 0) {
|
if(viewSet.resources.length === 0) {
|
||||||
return <Empty>This project has no notebooks.</Empty>
|
return <Empty>This project has no notebooks.</Empty>
|
||||||
}
|
}
|
||||||
return viewSet.resources?.filter(res => res !== undefined).map(res => <NotebookResourcePanel resource={res} key={res.value.slug}/>)
|
return viewSet.resources?.filter(res => Boolean(res)).map(res => <NotebookResourcePanel resource={res} key={res.value.slug}/>)
|
||||||
},
|
},
|
||||||
[viewSet],
|
[viewSet],
|
||||||
)
|
)
|
||||||
|
|
|
@ -21,7 +21,7 @@ export function ProjectListBox({viewSet}: ProjectListBoxProps): JSX.Element {
|
||||||
if(viewSet.resources.length === 0) {
|
if(viewSet.resources.length === 0) {
|
||||||
return <Empty>This group owns no projects.</Empty>
|
return <Empty>This group owns no projects.</Empty>
|
||||||
}
|
}
|
||||||
return viewSet.resources?.filter(res => res !== undefined).map(res => <ProjectResourcePanel resource={res} key={res.value.slug}/>)
|
return viewSet.resources?.filter(res => Boolean(res)).map(res => <ProjectResourcePanel resource={res} key={res.value.slug}/>)
|
||||||
},
|
},
|
||||||
[viewSet],
|
[viewSet],
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue