* Make page import handling better

This commit is contained in:
Philipinho
2024-07-21 20:48:33 +01:00
parent e5a97d2a26
commit 89f6311e46
8 changed files with 124 additions and 111 deletions

View File

@ -84,14 +84,14 @@ function ImportFormatSelection({ spaceId, onClose }: ImportFormatSelection) {
}
}
const newTreeNodes = buildTree(pages);
const fullTree = treeData.concat(newTreeNodes);
if (pages?.length > 0 && pageCount > 0) {
const newTreeNodes = buildTree(pages);
const fullTree = treeData.concat(newTreeNodes);
if (newTreeNodes?.length && fullTree?.length > 0) {
setTreeData(fullTree);
}
if (newTreeNodes?.length && fullTree?.length > 0) {
setTreeData(fullTree);
}
if (pageCount > 0) {
const pageCountText = pageCount === 1 ? "1 page" : `${pageCount} pages`;
notifications.update({