未验证 提交 3ed91514 编写于 作者: Ʈ ʈᵃᵢ 提交者: GitHub

fix(alerts/reports): misconfigured useEffect hook breaks form validation in prod builds (#12779)

上级 017f11f9
......@@ -992,27 +992,23 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
}, [resource]);
// Validation
useEffect(
() => {
validate();
},
currentAlert
? [
currentAlert.name,
currentAlert.owners,
currentAlert.database,
currentAlert.sql,
currentAlert.validator_config_json,
currentAlert.crontab,
currentAlert.working_timeout,
currentAlert.dashboard,
currentAlert.chart,
contentType,
notificationSettings,
conditionNotNull,
]
: [],
);
const currentAlertSafe = currentAlert || {};
useEffect(() => {
validate();
}, [
currentAlertSafe.name,
currentAlertSafe.owners,
currentAlertSafe.database,
currentAlertSafe.sql,
currentAlertSafe.validator_config_json,
currentAlertSafe.crontab,
currentAlertSafe.working_timeout,
currentAlertSafe.dashboard,
currentAlertSafe.chart,
contentType,
notificationSettings,
conditionNotNull,
]);
// Show/hide
if (isHidden && show) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册