@bindu-dashing/dam-solution-v2 5.8.195 → 5.8.196

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -244,8 +244,23 @@ function FolderTree({ currentRootId, expandedKeys, selectedKeys, handleExpand, s
244
244
  fetchFolders(currentRootId);
245
245
  }
246
246
  else {
247
- console.log('## Folder not in tree but tree has content - keeping existing tree structure');
248
- prevCurrentRootIdRef.current = currentRootId;
247
+ // Folder not in tree - it may be a nested subfolder (e.g. "Books Sub folder" under "Book")
248
+ // Fetch children for top-level folders until the target appears in the tree
249
+ console.log('## Folder not in tree - fetching children to find nested subfolder:', currentRootId);
250
+ (() => __awaiter(this, void 0, void 0, function* () {
251
+ setState((s) => (Object.assign(Object.assign({}, s), { loading: true })));
252
+ for (const folder of folders) {
253
+ const fid = get(folder, "_id");
254
+ if (!fid)
255
+ continue;
256
+ const hasChildrenLoaded = isArray(folder.children) && folder.children.length > 0;
257
+ if (!hasChildrenLoaded) {
258
+ yield fetchFolderChildren(fid);
259
+ // Effect will re-run when folders update; if target is now in tree, we'll expand
260
+ }
261
+ }
262
+ setState((s) => (Object.assign(Object.assign({}, s), { loading: false })));
263
+ }))();
249
264
  }
250
265
  }
251
266
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bindu-dashing/dam-solution-v2",
3
- "version": "5.8.195",
3
+ "version": "5.8.196",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.0.1",
6
6
  "@emoji-mart/data": "^1.2.1",