Просмотр исходного кода

replace parentPagePath with currentPagePath

WNomunomu 1 год назад
Родитель
Сommit
785c3aec39

+ 3 - 3
apps/app/src/components/PageSelectModal/PageSelectModal.tsx

@@ -71,11 +71,11 @@ export const PageSelectModal: FC = () => {
     return;
   }
 
-  const parentPagePath = pathUtils.addTrailingSlash(nodePath.dirname(currentPage.path));
+  // const parentPagePath = pathUtils.addTrailingSlash(nodePath.dirname(currentPage.path));
 
-  const targetPathOrId = clickedParentPagePath || parentPagePath;
+  const targetPathOrId = clickedParentPagePath || currentPage.path;
 
-  const targetPath = clickedParentPagePath || parentPagePath;
+  const targetPath = clickedParentPagePath || currentPage.path;
 
   // console.log(clickedParentPagePath);
   // console.log(targetPathOrId);

+ 0 - 5
apps/app/src/components/TreeItem/TreeItemLayout.tsx

@@ -25,16 +25,11 @@ const markTarget = (page: IPageForItem, children: ItemNode[], targetPathOrId?: N
     return;
   }
 
-  // console.log(targetPathOrId);
-
   page.isTarget = page.path === targetPathOrId;
 
-  // console.log(page.path);
-
   children.forEach((node) => {
     if (node.page._id === targetPathOrId || node.page.path === targetPathOrId) {
       node.page.isTarget = true;
-      console.log(node.page);
     }
     else {
       node.page.isTarget = false;