Skip to content

Commit 853ebb7

Browse files
committed
Fix issue with
- fix issue with item.metadata.data not getting set if item.metadata was undefined - fix issue with incorrect check on node.type (if it is a file, it should return no children, but if it is a directory it should return the node children)
1 parent d54854c commit 853ebb7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

web/pgadmin/static/js/tree/tree_nodes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class ManageTreeNodes {
3636
if (item) {
3737
item.data = {...item.data, ..._data};
3838
item.name = _data.label;
39-
item.metadata.data = _data;
39+
item.metadata = { data: _data, ...item.metadata };
4040
}
4141
res(true);
4242
});
@@ -81,7 +81,7 @@ export class ManageTreeNodes {
8181
const api = getApiInstance();
8282

8383
if (node && node.children.length > 0) {
84-
if (node.type !== FileType.File) {
84+
if (node.type === FileType.File) {
8585
console.error(node, 'It\'s a leaf node');
8686
return [];
8787
}

0 commit comments

Comments
 (0)