1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-21 22:05:38 -04:00

New: Use natural sorting for lists of items in the UI

Closes #6955
This commit is contained in:
Mark McDowall
2024-07-16 21:34:43 -07:00
committed by GitHub
parent e35b39b4b1
commit 1a1c8e6c08
29 changed files with 83 additions and 57 deletions
@@ -2,12 +2,11 @@ import { createSelector } from 'reselect';
import RootFolderAppState from 'App/State/RootFolderAppState';
import createSortedSectionSelector from 'Store/Selectors/createSortedSectionSelector';
import RootFolder from 'typings/RootFolder';
import sortByProp from 'Utilities/Array/sortByProp';
export default function createRootFoldersSelector() {
return createSelector(
createSortedSectionSelector('rootFolders', (a: RootFolder, b: RootFolder) =>
a.path.localeCompare(b.path)
),
createSortedSectionSelector<RootFolder>('rootFolders', sortByProp('path')),
(rootFolders: RootFolderAppState) => rootFolders
);
}