Fixing UI for 2.1 data changes

This commit is contained in:
Thaum Rystra
2024-03-23 16:02:28 +02:00
parent 293deaa592
commit 359d645f6b
40 changed files with 2142 additions and 510 deletions

View File

@@ -1,8 +0,0 @@
export default function walkDown(tree, callback){
let stack = [...tree];
while(stack.length){
let node = stack.pop();
callback(node, stack);
stack.push(...node.children);
}
}

View File

@@ -0,0 +1,14 @@
import { TreeDoc } from '/imports/api/parenting/ChildSchema';
import { TreeNode } from '/imports/api/parenting/parentingFunctions';
export default function walkDown<T extends TreeDoc>(
trees: TreeNode<T>[], callback: (node: TreeNode<T>, stack: TreeNode<T>[]) => any
) {
const stack = [...trees];
while (stack.length) {
const node = stack.pop();
if (!node) return;
callback(node, stack);
stack.push(...node.children);
}
}