Skip to content

Commit

Permalink
Merge pull request #994 from umbraco/feature/fix-for-items-in-folders
Browse files Browse the repository at this point in the history
fix issue of item showing up multiple times in folders
  • Loading branch information
madsrasmussen authored Nov 17, 2023
2 parents 81428bf + 783ea84 commit cc87bfe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/packages/core/tree/file-system-tree.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ export class UmbFileSystemTreeStore
return this.rootItems;
}

return this._data.asObservablePart((items) => items.filter((item) => item.path?.startsWith(parentPath + '/')));
return this._data.asObservablePart((items) =>
items.filter((item) => {
const pathCut = item.path?.substring(0, item.path?.lastIndexOf('/'));
return parentPath === pathCut;
}),
);
}

/**
Expand Down

0 comments on commit cc87bfe

Please sign in to comment.