From bdb31137bd2c4490e7fecaa695767c7911cebd91 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Tue, 20 Aug 2024 18:00:38 +0800 Subject: [PATCH] Fix empty edges in useMemo Still need to track downt the root cause of this. --- packages/web/components/templates/library/LibraryContainer.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/web/components/templates/library/LibraryContainer.tsx b/packages/web/components/templates/library/LibraryContainer.tsx index 2a1d72441..6bb4829bd 100644 --- a/packages/web/components/templates/library/LibraryContainer.tsx +++ b/packages/web/components/templates/library/LibraryContainer.tsx @@ -164,6 +164,9 @@ export function LibraryContainer(props: LibraryContainerProps): JSX.Element { const items = itemsPages?.pages .flatMap((ad: LibraryItems) => { + if (!ad.edges) { + return [] + } return ad.edges.map((it) => ({ ...it, isLoading: it.node.state === 'PROCESSING',