aboutsummaryrefslogtreecommitdiffstats
path: root/ui-react/src/components/loop_viewer
diff options
context:
space:
mode:
Diffstat (limited to 'ui-react/src/components/loop_viewer')
-rw-r--r--ui-react/src/components/loop_viewer/svg/LoopSvg.js17
1 files changed, 10 insertions, 7 deletions
diff --git a/ui-react/src/components/loop_viewer/svg/LoopSvg.js b/ui-react/src/components/loop_viewer/svg/LoopSvg.js
index 3ac2f31f..1b1e2428 100644
--- a/ui-react/src/components/loop_viewer/svg/LoopSvg.js
+++ b/ui-react/src/components/loop_viewer/svg/LoopSvg.js
@@ -61,13 +61,14 @@ class LoopViewSvg extends React.Component {
return this.state.svgContent !== nextState.svgContent;
}
- componentWillReceiveProps(newProps) {
- this.setState({
- loopCache: newProps.loopCache,
- componentModalMapping: LoopComponentConverter.buildMapOfComponents(newProps.loopCache),
-
- });
- this.getSvg(newProps.loopCache.getLoopName());
+ componentWillReceiveProps(newProps) {
+ if (this.state.loopCache !== newProps.loopCache) {
+ this.setState({
+ loopCache: newProps.loopCache,
+ componentModalMapping: LoopComponentConverter.buildMapOfComponents(newProps.loopCache),
+ });
+ this.getSvg(newProps.loopCache.getLoopName());
+ }
}
getSvg(loopName) {
@@ -79,6 +80,8 @@ class LoopViewSvg extends React.Component {
this.setState({ svgContent: LoopViewSvg.emptySvg })
}
});
+ } else {
+ this.setState({ svgContent: LoopViewSvg.emptySvg })
}
}