Skip to content

Commit

Permalink
[Code] fix a tree expand/collapse problem (#33227)
Browse files Browse the repository at this point in the history
  • Loading branch information
spacedragon authored Mar 14, 2019
1 parent df2d425 commit b28e091
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions x-pack/plugins/code/public/components/file_tree/file_tree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,6 @@ interface Props extends RouteComponentProps<MainRouteParams> {
}

export class CodeFileTree extends React.Component<Props> {
public componentDidUpdate(prevProps: Readonly<Props>): void {
const { openedPaths, match, treeLoading } = this.props;
const path = match.params.path;
if (path) {
if (prevProps.match.params.path !== path || prevProps.treeLoading !== treeLoading) {
if (!openedPaths.includes(path)) {
this.props.openTreePath(path);
}
}
}
}

public componentDidMount(): void {
const { path } = this.props.match.params;
if (path) {
Expand Down

0 comments on commit b28e091

Please sign in to comment.