state = {
svgContent: LoopViewSvg.emptySvg,
loopCache: new LoopCache({}),
- componentModalMapping: new Map([]),
+ componentModalMapping: new Map([])
}
constructor(props) {
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) {
this.setState({ svgContent: LoopViewSvg.emptySvg })
}
});
+ } else {
+ this.setState({ svgContent: LoopViewSvg.emptySvg })
}
}