diff options
author | Mathieu Suen <mathieu.suen@sonarsource.com> | 2022-04-25 11:18:53 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-04-25 20:02:45 +0000 |
commit | 64f91092e3303593f6bed7f24a02a20c36a2b5f7 (patch) | |
tree | 8c71cb105e48537cd6d1978095ce13cc066efd6e /server/sonar-web/src/main/js/apps/settings/components | |
parent | adc7b775698154811b7d06360f8a02a7907b1183 (diff) | |
download | sonarqube-64f91092e3303593f6bed7f24a02a20c36a2b5f7.tar.gz sonarqube-64f91092e3303593f6bed7f24a02a20c36a2b5f7.zip |
SONAR-16301 Replace React legacy lifecycle methods in settings
Diffstat (limited to 'server/sonar-web/src/main/js/apps/settings/components')
-rw-r--r-- | server/sonar-web/src/main/js/apps/settings/components/inputs/InputForSecured.tsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForSecured.tsx b/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForSecured.tsx index fb6f21e509c..23bdb1d0edd 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForSecured.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/inputs/InputForSecured.tsx @@ -42,7 +42,7 @@ export default class InputForSecured extends React.PureComponent<Props, State> { changing: !this.props.setting.hasValue }; - componentWillReceiveProps(nextProps: Props) { + componentDidUpdate(prevProps: Props) { /* * Reset `changing` if: * - the value is reset (valueChanged -> !valueChanged) @@ -50,10 +50,10 @@ export default class InputForSecured extends React.PureComponent<Props, State> { * - the value changes from outside the input (i.e. store update/reset/cancel) */ if ( - (this.props.hasValueChanged || this.props.setting !== nextProps.setting) && - !nextProps.hasValueChanged + (prevProps.hasValueChanged || this.props.setting !== prevProps.setting) && + !this.props.hasValueChanged ) { - this.setState({ changing: !nextProps.setting.hasValue }); + this.setState({ changing: !this.props.setting.hasValue }); } } |