1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-26 22:56:23 -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,6 +2,7 @@ import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import createSeriesSelector from 'Store/Selectors/createSeriesSelector';
import createTagsSelector from 'Store/Selectors/createTagsSelector';
import sortByProp from 'Utilities/Array/sortByProp';
import SeriesTags from './SeriesTags';
function createMapStateToProps() {
@@ -12,8 +13,8 @@ function createMapStateToProps() {
const tags = series.tags
.map((tagId) => tagList.find((tag) => tag.id === tagId))
.filter((tag) => !!tag)
.map((tag) => tag.label)
.sort((a, b) => a.localeCompare(b));
.sort(sortByProp('label'))
.map((tag) => tag.label);
return {
tags