Skip to content

Commit d3bceb5

Browse files
committed
Re-render graph also when engine is changed
Amends d0c44e9
1 parent 6d3729f commit d3bceb5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Graph.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class Graph extends React.Component {
4949
this.pendingUpdate = false;
5050
this.rendering = false;
5151
this.prevFit = null;
52+
this.prevEngine = null;
5253
this.prevDotSrc = '';
5354
}
5455

@@ -91,7 +92,7 @@ class Graph extends React.Component {
9192
if (this.props.dotSrc.length === 0) {
9293
return;
9394
}
94-
if (this.props.dotSrc === this.prevDotSrc) {
95+
if (this.props.dotSrc === this.prevDotSrc && this.props.engine === this.prevEngine) {
9596
return;
9697
}
9798
if (this.rendering) {
@@ -111,6 +112,7 @@ class Graph extends React.Component {
111112
this.prevFit = this.props.fit;
112113
}
113114
this.prevDotSrc = this.props.dotSrc;
115+
this.prevEngine = this.props.engine;
114116
try {
115117
this.prelDotGraph = new DotGraph(this.props.dotSrc);
116118
}

0 commit comments

Comments
 (0)