fix: path for newly added collection & remove option for outside collections (#6331)

* fixes

* fixes

* fix
This commit is contained in:
naman-bruno
2025-12-06 18:43:53 +05:30
committed by GitHub
parent 3e5ae613f5
commit 4ffb447c53
7 changed files with 83 additions and 56 deletions

View File

@@ -6,6 +6,7 @@ import StyledWrapper from './StyledWrapper';
import CreateOrOpenCollection from './CreateOrOpenCollection';
import CollectionSearch from './CollectionSearch/index';
import { useMemo } from 'react';
import { normalizePath } from 'utils/common/path';
const Collections = ({ showSearch }) => {
const [searchText, setSearchText] = useState('');
@@ -18,7 +19,7 @@ const Collections = ({ showSearch }) => {
const workspaceCollections = useMemo(() => {
if (!activeWorkspace) return [];
return collections.filter((c) =>
activeWorkspace.collections?.some((wc) => wc.path === c.pathname)
activeWorkspace.collections?.some((wc) => normalizePath(wc.path) === normalizePath(c.pathname))
);
}, [activeWorkspace, collections]);