From fe1567fa78cf71296786ae3a8e169951f2b7bb8f Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Fri, 23 Aug 2024 14:24:00 +0800 Subject: [PATCH] Allow the highlights attribute of articles to be undefined --- packages/web/components/templates/article/ArticleContainer.tsx | 2 +- packages/web/lib/networking/library_items/useLibraryItems.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/web/components/templates/article/ArticleContainer.tsx b/packages/web/components/templates/article/ArticleContainer.tsx index 1e5af9281..5ceabb2b6 100644 --- a/packages/web/components/templates/article/ArticleContainer.tsx +++ b/packages/web/components/templates/article/ArticleContainer.tsx @@ -520,7 +520,7 @@ export function ArticleContainer(props: ArticleContainerProps): JSX.Element { viewer={props.viewer} item={props.article} scrollToHighlight={highlightHref} - highlights={props.article.highlights} + highlights={props.article.highlights ?? []} isAppleAppEmbed={props.isAppleAppEmbed} highlightBarDisabled={props.highlightBarDisabled} showHighlightsModal={props.showHighlightsModal} diff --git a/packages/web/lib/networking/library_items/useLibraryItems.tsx b/packages/web/lib/networking/library_items/useLibraryItems.tsx index 8545357b7..454c96229 100644 --- a/packages/web/lib/networking/library_items/useLibraryItems.tsx +++ b/packages/web/lib/networking/library_items/useLibraryItems.tsx @@ -982,7 +982,7 @@ export type ArticleAttributes = { folder: string savedByViewer?: boolean content: string - highlights: Highlight[] + highlights?: Highlight[] linkId: string labels?: Label[] state?: State