Yuki Takei 9 лет назад
Родитель
Сommit
b80d39ecb7
1 измененных файлов с 7 добавлено и 2 удалено
  1. 7 2
      packages/growi-plugin-lsx/src/resource/js/components/Lsx.jsx

+ 7 - 2
packages/growi-plugin-lsx/src/resource/js/components/Lsx.jsx

@@ -104,13 +104,18 @@ export class Lsx extends React.Component {
     // return root objects
     let rootNodes = [];
     Object.keys(pathToNodeMap).forEach((pagePath) => {
+      // exclude '/'
+      if (pagePath === '/') {
+        return;
+      }
+
       const parentPath = this.getParentPath(pagePath);
+
       // pick up what parent doesn't exist
-      if (!(parentPath in pathToNodeMap)) {
+      if ((parentPath === '/') || !(parentPath in pathToNodeMap)) {
         rootNodes.push(pathToNodeMap[pagePath]);
       }
     });
-
     return rootNodes;
   }