From 9ab1ed3d90ac4350ca87f7a0812d09c5e9cb8b54 Mon Sep 17 00:00:00 2001 From: naman-bruno Date: Tue, 20 Jan 2026 12:38:31 +0530 Subject: [PATCH] fix: update clone collection location logic based on active workspace (#6841) --- .../Collections/Collection/CloneCollection/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/bruno-app/src/components/Sidebar/Collections/Collection/CloneCollection/index.js b/packages/bruno-app/src/components/Sidebar/Collections/Collection/CloneCollection/index.js index 66c0fcd62..6dbb69064 100644 --- a/packages/bruno-app/src/components/Sidebar/Collections/Collection/CloneCollection/index.js +++ b/packages/bruno-app/src/components/Sidebar/Collections/Collection/CloneCollection/index.js @@ -20,7 +20,14 @@ const CloneCollection = ({ onClose, collectionUid }) => { const [isEditing, toggleEditing] = useState(false); const collection = useSelector((state) => findCollectionByUid(state.collections.collections, collectionUid)); const preferences = useSelector((state) => state.app.preferences); - const defaultLocation = get(preferences, 'general.defaultCollectionLocation', ''); + const workspaces = useSelector((state) => state.workspaces?.workspaces || []); + const workspaceUid = useSelector((state) => state.workspaces?.activeWorkspaceUid); + const activeWorkspace = workspaces.find((w) => w.uid === workspaceUid); + const isDefaultWorkspace = activeWorkspace?.type === 'default'; + + const defaultLocation = isDefaultWorkspace + ? get(preferences, 'general.defaultCollectionLocation', '') + : (activeWorkspace?.pathname ? `${activeWorkspace.pathname}/collections` : ''); const { name } = collection; const formik = useFormik({