Skip to content

Commit

Permalink
fix(admin): fix admin debug pane not working (#11421)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentlp committed Feb 8, 2022
1 parent 8140a3f commit ada9d1f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/ui-admin/src/app/BottomPanel/Logs/Debug.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,13 @@ export default class Debug extends React.Component<Props, State> {
buildNodeRecursive(node: any, path: string[], index: number) {
if (index < path.length) {
const item = path[index]
let directory = node.children.find((child: any) => child.label === item)
let directory = node.children?.find((child: any) => child.label === item)
if (!directory) {
directory = { label: item, value: path.slice(0, index + 1).join(':'), children: [] }
directory = { label: item, value: path.slice(0, index + 1).join(':') }

if (!node.children) {
node.children = []
}
node.children.push(directory)
}
this.buildNodeRecursive(directory, path, index + 1)
Expand All @@ -82,6 +86,7 @@ export default class Debug extends React.Component<Props, State> {
<CheckboxTree
nodes={this.state.nodes || []}
checked={this.state.checked}
checkModel={'all'}
expanded={this.state.expanded}
onCheck={checked => this.setState({ checked })}
onExpand={expanded => this.setState({ expanded: ['bp', ...expanded] })}
Expand Down

0 comments on commit ada9d1f

Please sign in to comment.