fix: avoid infinite loop (#3089)

This commit is contained in:
被雨水过滤的空气-Rain 2023-11-24 17:35:45 +08:00 committed by GitHub
parent 641d59421d
commit e5f711ec66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -138,14 +138,14 @@ const WithForm = (props: WithFormProps) => {
variables,
localVariables,
});
// 如果是 linkageRules 数组的最后一个元素
if (index === linkageRules.length - 1) {
// 清空 linkagefields 数组中对象的属性
linkagefields.forEach((v) => {
v.linkageProperty = {};
// 如果不在这里使用 setTimeout 会在某些未知情况下导致死循环,原因未知
setTimeout(() => {
linkagefields.forEach((v) => {
v.linkageProperty = {};
});
linkagefields.length = 0;
});
// 清空 linkagefields 数组
linkagefields.length = 0;
}
}),
);