Skip to content

Commit f061059

Browse files
committed
tweaked deepIterate
1 parent 6798dee commit f061059

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

app/src/components/main/DemoRender.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ const DemoRender = (): JSX.Element => {
6161
const innerText = element.attributes.compText;
6262
const classRender = element.attributes.cssClasses;
6363
const activeLink = element.attributes.compLink;
64-
console.log('activeLink', activeLink);
6564
let renderedChildren;
6665
if (elementType !== 'input' && elementType !== 'img' && element.children.length > 0) {
6766
renderedChildren = componentBuilder(element.children);

app/src/containers/CustomizationPanel.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,13 @@ const CustomizationPanel = ({ isThemeLight }): JSX.Element => {
5151
//Miko -- save properties of nested div
5252
function deepIterate(arr) {
5353
const output = [];
54-
function recurse(arr) {
55-
for(let i = 0; i < arr.length; i++) {
56-
output.push(arr[i]);
57-
if(arr[i].children.length) {
58-
recurse(arr[i].children);
59-
}
54+
for(let i = 0; i < arr.length; i++) {
55+
if(arr[i].typeId === 1000) continue;
56+
output.push(arr[i]);
57+
if(arr[i].children.length) {
58+
output.push(...deepIterate(arr[i].children));
6059
}
6160
}
62-
recurse(arr);
6361
return output;
6462
}
6563

0 commit comments

Comments
 (0)