diff --git a/frontend/components/icons/OrgLogoIcon/OrgLogoIcon.jsx b/frontend/components/icons/OrgLogoIcon/OrgLogoIcon.jsx index 2e1c3f3b6..5ab62fc74 100644 --- a/frontend/components/icons/OrgLogoIcon/OrgLogoIcon.jsx +++ b/frontend/components/icons/OrgLogoIcon/OrgLogoIcon.jsx @@ -28,18 +28,41 @@ class OrgLogoIcon extends Component { componentWillReceiveProps (nextProps) { const { src } = nextProps; + const { unchangedSourceProp } = this; + + if (unchangedSourceProp(nextProps)) { + return false; + } this.setState({ imageSrc: src }); return false; } + shouldComponentUpdate (nextProps) { + const { imageSrc } = this.state; + const { unchangedSourceProp } = this; + + if (unchangedSourceProp(nextProps) && (imageSrc === kolideLogo)) { + return false; + } + + return true; + } + onError = () => { this.setState({ imageSrc: kolideLogo }); return false; } + unchangedSourceProp = (nextProps) => { + const { src: nextSrcProp } = nextProps; + const { src } = this.props; + + return src === nextSrcProp; + } + render () { const { className } = this.props; const { imageSrc } = this.state;