X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ui-react%2Fsrc%2Fcomponents%2Floop_viewer%2Fsvg%2FLoopSvg.js;h=1b1e24280e5a54ad22f1c0e252dd585668186817;hb=691e2b7a8bb16d224a0fbe30390152ea309e88e2;hp=3ac2f31fd157ad9b6474e18608902f69366a9d1c;hpb=fa6dd7312e06dd5a6e70d79c1a00438f3c80e7eb;p=clamp.git 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 }) } }