Skip to content

Commit

Permalink
Fixed deprecation warning:
Browse files Browse the repository at this point in the history
- Accessing "Node.attributes.displayname" is deprecated, access it directly on the Node instance

Signed-off-by: Dennis Vestergaard Værum <[email protected]>
  • Loading branch information
dvaerum committed Sep 10, 2024
1 parent ae0a991 commit d60e47a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils/fileSorting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function sortNodes(nodes: readonly INode[], options: FilesSortingOptions
// 3: Use sorting mode if NOT basename (to be able to use display name too)
...(sortingOptions.sortingMode !== FilesSortingMode.Name ? [(v: INode) => v[sortingOptions.sortingMode]] : []),
// 4: Use display name if available, fallback to name
(v: INode) => basename(v.attributes?.displayname || v.basename),
(v: INode) => basename(v.displayname || v.basename),
// 5: Finally, use basename if all previous sorting methods failed
(v: INode) => v.basename,
]
Expand Down

0 comments on commit d60e47a

Please sign in to comment.