Skip to content

Commit

Permalink
Fixes jaegertracing#10: Infinite loop when no services are found
Browse files Browse the repository at this point in the history
  • Loading branch information
Shan Aminzadeh committed May 23, 2017
1 parent 5c6e639 commit 19aff70
Showing 1 changed file with 9 additions and 19 deletions.
28 changes: 9 additions & 19 deletions src/components/DependencyGraph/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,34 +53,24 @@ export default class DependencyGraphPage extends Component {
};
}
componentDidMount() {
this.ensureDependenciesFetched();
}

componentDidUpdate() {
const { nodes, links } = this.props;

if (!nodes || !links) {
this.ensureDependenciesFetched();
}
}

ensureDependenciesFetched() {
const { fetchDependencies, nodes, links, loading, error } = this.props;

if (!(nodes && links) && !(loading || error)) {
fetchDependencies();
}
this.props.fetchDependencies();
}

handleGraphTypeChange(graphType) {
this.setState({ graphType });
}

render() {
const { nodes, links, error, dependencies } = this.props;
const { nodes, links, error, dependencies, loading } = this.props;
const { graphType } = this.state;
const serviceCalls = dependencies.toJS();

if (loading) {
return (
<div className="m1">
<div className="ui active centered inline loader" />
</div>
);
}
if (error) {
return <NotFound error={error} />;
}
Expand Down

0 comments on commit 19aff70

Please sign in to comment.