add check to return rootItems if parentId is null
This commit is contained in:
@@ -31,9 +31,11 @@ export class UmbFileSystemTreeStore
|
||||
* @memberof UmbFileSystemTreeStore
|
||||
*/
|
||||
childrenOf(parentPath: string | null) {
|
||||
return this._data.asObservablePart((items) =>
|
||||
items.filter((item) => item.path?.startsWith(parentPath + '/') || parentPath === null)
|
||||
);
|
||||
if (parentPath === null) {
|
||||
return this.rootItems;
|
||||
}
|
||||
|
||||
return this._data.asObservablePart((items) => items.filter((item) => item.path?.startsWith(parentPath + '/')));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user