Browse Source

change default targetPath to parentPagePath

WNomunomu 1 year ago
parent
commit
6a8851f10f
1 changed files with 4 additions and 2 deletions
  1. 4 2
      apps/app/src/components/PageSelectModal/PageSelectModal.tsx

+ 4 - 2
apps/app/src/components/PageSelectModal/PageSelectModal.tsx

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