From 36ee42084c734d7e9ba799bc0869555f59afbda0 Mon Sep 17 00:00:00 2001 From: Charlie Jonas Date: Mon, 24 Jan 2022 20:40:42 -0700 Subject: [PATCH] fix: issue-2974 reparent nested document when dropped on current collection (#2975) --- app/components/Sidebar/components/CollectionLink.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/components/Sidebar/components/CollectionLink.tsx b/app/components/Sidebar/components/CollectionLink.tsx index c082ec1cf..ce8b8d27b 100644 --- a/app/components/Sidebar/components/CollectionLink.tsx +++ b/app/components/Sidebar/components/CollectionLink.tsx @@ -81,7 +81,12 @@ function CollectionLink({ const { id, collectionId } = item; if (monitor.didDrop()) return; if (!collection) return; - if (collection.id === collectionId) return; + + const document = documents.get(id); + if (collection.id === collectionId && !document?.parentDocumentId) { + return; + } + const prevCollection = collections.get(collectionId); if (