This commit is contained in:
rizrmd 2024-05-25 01:03:34 +07:00
parent 960162fa08
commit 0776995880
1 changed files with 8 additions and 0 deletions

View File

@ -28,7 +28,15 @@ export const expandTreeHook = (
shouldOpen.add(id);
let meta: IMeta | undefined = getMetaById(p, id);
let i = 0;
while (meta) {
i++;
if (i > 5000) {
console.warn(
"WARNING: Prasi expand item parent tree exceed 5000 loop, maybe infinite loop?"
);
break;
}
const id = meta.parent?.id;
if (id) {
meta = getMetaById(p, id);