From 72c7b0373bd292a301735c502708dd927990269a Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Mon, 3 Jul 2023 20:23:06 -0400 Subject: [PATCH] fix: Small rendering flash in sidebar when document slug changes --- app/components/Sidebar/components/DocumentLink.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/components/Sidebar/components/DocumentLink.tsx b/app/components/Sidebar/components/DocumentLink.tsx index b064eccc1..f76d563ea 100644 --- a/app/components/Sidebar/components/DocumentLink.tsx +++ b/app/components/Sidebar/components/DocumentLink.tsx @@ -334,9 +334,9 @@ function InnerDocumentLink( /> } isActive={(match, location: Location<{ starred?: boolean }>) => - (document - ? location.pathname.endsWith(document.urlId) - : !!match) && location.state?.starred === inStarredSection + ((document && location.pathname.endsWith(document.urlId)) || + !!match) && + location.state?.starred === inStarredSection } isActiveDrop={isOverReparent && canDropToReparent} depth={depth}