fix: show recursive items (#3750)

This commit is contained in:
Peng Xiao 2023-08-15 12:01:46 +08:00 committed by GitHub
parent 8487b2c4af
commit 2830cb19fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,14 +29,8 @@ export const ReferencePage = ({
const icon = setting?.mode === 'edgeless' ? <EdgelessIcon /> : <PageIcon />;
const references = useBlockSuitePageReferences(workspace, pageId);
const referencesToShow = useMemo(() => {
return [
...new Set(
references.filter(
ref => !parentIds.has(ref) && !metaMapping[ref]?.trash
)
),
];
}, [references, parentIds, metaMapping]);
return [...new Set(references.filter(ref => !metaMapping[ref]?.trash))];
}, [references, metaMapping]);
const [collapsed, setCollapsed] = useState(true);
const collapsible = referencesToShow.length > 0;
const nestedItem = parentIds.size > 0;