aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/settings/components
diff options
context:
space:
mode:
authorMathieu Suen <mathieu.suen@sonarsource.com>2022-04-25 11:18:53 +0200
committersonartech <sonartech@sonarsource.com>2022-04-25 20:02:45 +0000
commit64f91092e3303593f6bed7f24a02a20c36a2b5f7 (patch)
tree8c71cb105e48537cd6d1978095ce13cc066efd6e /server/sonar-web/src/main/js/apps/settings/components
parentadc7b775698154811b7d06360f8a02a7907b1183 (diff)
downloadsonarqube-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.tsx8
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 });
}
}