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}