fix: empty object missing in variable tree (#391)

This commit is contained in:
Yiwei Mao 2025-06-19 17:03:27 +08:00 committed by GitHub
parent d21cdae3ea
commit e385211484
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 8 deletions

View File

@ -62,10 +62,6 @@ export function useVariableTree(params: {
children = (type.properties || [])
.map((_property) => renderVariable(_property as VariableField, [...parentFields, variable]))
.filter(Boolean) as TreeNodeData[];
if (!children?.length) {
return null;
}
}
const keyPath = [...parentFields.map((_field) => _field.key), variable.key];

View File

@ -61,10 +61,6 @@ export function useVariableTree(params: {
children = (type.properties || [])
.map((_property) => renderVariable(_property as VariableField, [...parentFields, variable]))
.filter(Boolean) as TreeNodeData[];
if (!children?.length) {
return null;
}
}
const keyPath = [...parentFields.map((_field) => _field.key), variable.key];
@ -76,6 +72,7 @@ export function useVariableTree(params: {
const isSchemaExclude = excludeSchema
? JsonSchemaUtils.isASTMatchSchema(type, excludeSchema)
: false;
const isSchemaMatch = isSchemaInclude && !isSchemaExclude;
// If not match, and no children, return null