aboutsummaryrefslogtreecommitdiffstats
path: root/ui-react/src/components/loop_viewer/svg/LoopSvg.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui-react/src/components/loop_viewer/svg/LoopSvg.js')
-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 3ac2f31fd..1b1e24280 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 })
}
}