Remove usage of deprecated componentWillReceiveProps

Change-type: patch
This commit is contained in:
Alexis Svinartchouk 2019-12-03 15:41:33 +01:00
parent 062723bf15
commit 220b7f6d53
3 changed files with 2 additions and 33 deletions

View File

@ -167,27 +167,6 @@ class SafeWebview extends react.PureComponent {
this.session.webRequest.onCompleted(null)
}
/**
* @summary Refresh the webview if we are navigating away from the success page
* @param {Object} nextProps - upcoming properties
*/
componentWillReceiveProps (nextProps) {
if (nextProps.refreshNow && !this.props.refreshNow) {
// Reload the page if it hasn't changed, otherwise reset the source URL,
// because reload interferes with 'src' setting, resetting the 'src' attribute
// to what it was was just prior.
if (this.refs.webview.src === this.entryHref) {
this.refs.webview.reload()
} else {
this.refs.webview.src = this.entryHref
}
this.setState({
shouldShow: true
})
}
}
/**
* @summary Set the element state to hidden
*/

View File

@ -133,15 +133,6 @@ class SVGIcon extends react.Component {
disabled: this.props.disabled
})
}
/**
* @summary Cause a re-render due to changed element properties
* @param {Object} nextProps - the new properties
*/
componentWillReceiveProps (nextProps) {
// This will update the element if the properties change
this.setState(nextProps)
}
}
SVGIcon.propTypes = {

View File

@ -38,9 +38,8 @@
ng-class="{
isFinish: state.currentName === 'success'
}">
<safe-webview
src="'https://www.balena.io/etcher/success-banner/'"
refresh-now="state.previousName === 'success'"></safe-webview>
<safe-webview src="'https://www.balena.io/etcher/success-banner/'">
</safe-webview>
</div>
</body>
</html>