From 00dad5e035b7e0adb774981687ebe317d2dfbcb2 Mon Sep 17 00:00:00 2001 From: Saumya Pandey Date: Thu, 17 Feb 2022 01:32:42 +0530 Subject: [PATCH] fix: remove isCollectionDropped --- app/components/Sidebar/components/CollectionLink.tsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/components/Sidebar/components/CollectionLink.tsx b/app/components/Sidebar/components/CollectionLink.tsx index c0fe1b42c0..53b3b88608 100644 --- a/app/components/Sidebar/components/CollectionLink.tsx +++ b/app/components/Sidebar/components/CollectionLink.tsx @@ -132,7 +132,7 @@ function CollectionLink({ // Drop to reorder collection const [ - { isCollectionDropping, isDraggingAnotherCollection, isCollectionDropped }, + { isCollectionDropping, isDraggingAnotherCollection }, dropToReorderCollection, ] = useDrop({ accept: "collection", @@ -151,7 +151,6 @@ function CollectionLink({ collect: (monitor) => ({ isCollectionDropping: monitor.isOver(), isDraggingAnotherCollection: monitor.canDrop(), - isCollectionDropped: monitor.didDrop(), }), }); @@ -206,14 +205,11 @@ function CollectionLink({ expandedStateBeforeDragging.current = expandedStateBeforeDragging.current ?? expanded; setExpanded(false); - } else if ( - isCollectionDropped && - expandedStateBeforeDragging.current !== null - ) { + } else if (expandedStateBeforeDragging.current !== null) { setExpanded(expandedStateBeforeDragging.current); expandedStateBeforeDragging.current = null; } - }, [expanded, isCollectionDropped, isDraggingAnyCollection]); + }, [expanded, isDraggingAnyCollection]); React.useEffect(() => { // If we're viewing a starred document through the starred menu then don't