Explorar el Código

use nodePath.resolve

Shun Miyazawa hace 4 años
padre
commit
96a5ccfd5c
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      packages/app/src/components/Sidebar/PageTree/Item.tsx

+ 1 - 1
packages/app/src/components/Sidebar/PageTree/Item.tsx

@@ -262,7 +262,7 @@ const Item: FC<ItemProps> = (props: ItemProps) => {
 
   const onPressEnterForRenameHandler = async(inputText: string) => {
     const parentPath = pathUtils.addTrailingSlash(nodePath.dirname(page.path ?? ''));
-    const newPagePath = `${parentPath}${inputText}`;
+    const newPagePath = nodePath.resolve(parentPath, inputText);
 
     if (newPagePath === page.path) {
       setRenameInputShown(false);