diff --git a/app/components/Sidebar/components/CollectionLink.tsx b/app/components/Sidebar/components/CollectionLink.tsx index ae0ba3d203..2a527746f5 100644 --- a/app/components/Sidebar/components/CollectionLink.tsx +++ b/app/components/Sidebar/components/CollectionLink.tsx @@ -65,13 +65,7 @@ const CollectionLink: React.FC = ({ const handleExpand = React.useCallback(() => { if (!expanded) { - // Create a synthetic event to pass to onDisclosureClick - const syntheticEvent = { - preventDefault: () => {}, - stopPropagation: () => {}, - } as React.MouseEvent; - - onDisclosureClick(syntheticEvent); + onDisclosureClick(); } }, [expanded, onDisclosureClick]); diff --git a/app/components/Sidebar/components/StarredLink.tsx b/app/components/Sidebar/components/StarredLink.tsx index be0fc7645d..f89706b9f0 100644 --- a/app/components/Sidebar/components/StarredLink.tsx +++ b/app/components/Sidebar/components/StarredLink.tsx @@ -78,9 +78,9 @@ function StarredLink({ star }: Props) { }, [documentId, documents]); const handleDisclosureClick = React.useCallback( - (ev: React.MouseEvent) => { - ev.preventDefault(); - ev.stopPropagation(); + (ev?: React.MouseEvent) => { + ev?.preventDefault(); + ev?.stopPropagation(); setExpanded((prevExpanded) => !prevExpanded); }, []