From 2dd86bbc2b0fdec2233dd661106ee077589fd0ff Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Fri, 11 Feb 2022 18:22:21 -0800 Subject: [PATCH] fix: Flash of uncolored pinned documents if pinned docs load before collections --- app/components/PinnedDocuments.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/components/PinnedDocuments.tsx b/app/components/PinnedDocuments.tsx index ddfff7d13..ce466afa7 100644 --- a/app/components/PinnedDocuments.tsx +++ b/app/components/PinnedDocuments.tsx @@ -34,7 +34,7 @@ type Props = { }; function PinnedDocuments({ limit, pins, canUpdate, ...rest }: Props) { - const { documents } = useStores(); + const { documents, collections } = useStores(); const [items, setItems] = React.useState(pins.map((pin) => pin.documentId)); React.useEffect(() => { @@ -82,6 +82,10 @@ function PinnedDocuments({ limit, pins, canUpdate, ...rest }: Props) { [pins] ); + if (collections.orderedData.length === 0) { + return null; + } + return (