fix Admin Menu
parent
723f8ab4d6
commit
c3fd6969d7
|
|
@ -28,6 +28,7 @@ export class PagesMenuComponent implements OnInit {
|
|||
resp=>{
|
||||
let [currentPage, rootPages] = resp
|
||||
if(currentPage){
|
||||
console.log('current')
|
||||
let menuTree = currentPage.parents.data.reduceRight(
|
||||
(menuTree,item)=>{
|
||||
let fothersSonID = item.children.data.findIndex(
|
||||
|
|
@ -38,7 +39,11 @@ export class PagesMenuComponent implements OnInit {
|
|||
}, currentPage);
|
||||
this.items = menuTree.children.data;
|
||||
}else{
|
||||
this.items = rootPages?.data[0].children.data
|
||||
if(rootPages){
|
||||
this.items = rootPages.data.find(
|
||||
page => page.slug == this.pagesService.rootPage.slug
|
||||
)?.children.data
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue