mirror of
https://github.com/Steffo99/sophon.git
synced 2024-12-22 14:54:22 +00:00
🐛 Filter out undefined elements in ListBox
es
This commit is contained in:
parent
f66ecf67fe
commit
da19f099e6
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?.map(res => <GroupResourcePanel resource={res} key={res.value?.slug}/>)
|
return viewSet.resources?.filter(res => res !== undefined).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?.map(res => <NotebookResourcePanel resource={res} key={res.value.slug}/>)
|
return viewSet.resources?.filter(res => res !== undefined).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?.map(res => <ProjectResourcePanel resource={res} key={res.value.slug}/>)
|
return viewSet.resources?.filter(res => res !== undefined).map(res => <ProjectResourcePanel resource={res} key={res.value.slug}/>)
|
||||||
},
|
},
|
||||||
[viewSet],
|
[viewSet],
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue