From da19f099e697da402a68d7787a47c035247dbe3d Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 23 Oct 2021 00:52:57 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Filter=20out=20undefined=20eleme?= =?UTF-8?q?nts=20in=20`ListBox`es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/group/GroupListBox.tsx | 2 +- frontend/src/components/notebook/NotebookListBox.tsx | 2 +- frontend/src/components/project/ProjectListBox.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/group/GroupListBox.tsx b/frontend/src/components/group/GroupListBox.tsx index 534b104..c3ca12f 100644 --- a/frontend/src/components/group/GroupListBox.tsx +++ b/frontend/src/components/group/GroupListBox.tsx @@ -21,7 +21,7 @@ export function GroupListBox({viewSet}: GroupListBoxProps): JSX.Element { if(viewSet.resources.length === 0) { return This Sophon instance has no groups. } - return viewSet.resources?.map(res => ) + return viewSet.resources?.filter(res => res !== undefined).map(res => ) }, [viewSet], ) diff --git a/frontend/src/components/notebook/NotebookListBox.tsx b/frontend/src/components/notebook/NotebookListBox.tsx index 6487883..dd702b9 100644 --- a/frontend/src/components/notebook/NotebookListBox.tsx +++ b/frontend/src/components/notebook/NotebookListBox.tsx @@ -21,7 +21,7 @@ export function NotebookListBox({viewSet}: NotebookListBoxProps): JSX.Element { if(viewSet.resources.length === 0) { return This project has no notebooks. } - return viewSet.resources?.map(res => ) + return viewSet.resources?.filter(res => res !== undefined).map(res => ) }, [viewSet], ) diff --git a/frontend/src/components/project/ProjectListBox.tsx b/frontend/src/components/project/ProjectListBox.tsx index 7e713a1..4e75f8d 100644 --- a/frontend/src/components/project/ProjectListBox.tsx +++ b/frontend/src/components/project/ProjectListBox.tsx @@ -21,7 +21,7 @@ export function ProjectListBox({viewSet}: ProjectListBoxProps): JSX.Element { if(viewSet.resources.length === 0) { return This group owns no projects. } - return viewSet.resources?.map(res => ) + return viewSet.resources?.filter(res => res !== undefined).map(res => ) }, [viewSet], )