Fix InitializeDefaultChild not using AddNewContainerToParent and ignoring subchildren
This commit is contained in:
parent
012c826461
commit
0d557624f7
1 changed files with 13 additions and 27 deletions
|
@ -264,22 +264,15 @@ function InitializeDefaultChild(
|
|||
return;
|
||||
}
|
||||
|
||||
let currentConfig = configuration.AvailableContainers
|
||||
const currentConfig = configuration.AvailableContainers
|
||||
.find(option => option.Type === containerConfig.DefaultChildType);
|
||||
let parent = newContainer;
|
||||
let depth = 0;
|
||||
const seen = new Set<string>([containerConfig.Type]);
|
||||
const parent = newContainer;
|
||||
|
||||
while (currentConfig !== undefined &&
|
||||
depth <= DEFAULTCHILDTYPE_MAX_DEPTH
|
||||
) {
|
||||
if (!DEFAULTCHILDTYPE_ALLOW_CYCLIC && seen.has(currentConfig.Type)) {
|
||||
if (currentConfig === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
seen.add(currentConfig.Type);
|
||||
|
||||
const newChildContainer = AddNewContainerToParent(
|
||||
AddNewContainerToParent(
|
||||
currentConfig,
|
||||
configuration,
|
||||
parent,
|
||||
|
@ -287,13 +280,6 @@ function InitializeDefaultChild(
|
|||
newCounters,
|
||||
symbols
|
||||
);
|
||||
|
||||
// iterate
|
||||
depth++;
|
||||
parent = newChildContainer;
|
||||
currentConfig = configuration.AvailableContainers
|
||||
.find(option => option.Type === (currentConfig as IAvailableContainer).DefaultChildType);
|
||||
}
|
||||
}
|
||||
|
||||
function InitializeChildrenWithPattern(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue