diff --git a/frontend/src/Settings/Tags/Details/TagDetailsModalContentConnector.js b/frontend/src/Settings/Tags/Details/TagDetailsModalContentConnector.js index 5a6c9e229..8cfee15c7 100644 --- a/frontend/src/Settings/Tags/Details/TagDetailsModalContentConnector.js +++ b/frontend/src/Settings/Tags/Details/TagDetailsModalContentConnector.js @@ -9,7 +9,7 @@ function findMatchingItems(ids, items) { }); } -function createMatchingSeriesSelector() { +function createUnorderedMatchingSeriesSelector() { return createSelector( (state, { seriesIds }) => seriesIds, createAllSeriesSelector(), @@ -17,6 +17,26 @@ function createMatchingSeriesSelector() { ); } +function createMatchingSeriesSelector() { + return createSelector( + createUnorderedMatchingSeriesSelector(), + (series) => { + return series.sort((seriesA, seriesB) => { + const sortTitleA = seriesA.sortTitle; + const sortTitleB = seriesB.sortTitle; + + if (sortTitleA > sortTitleB) { + return 1; + } else if (sortTitleA < sortTitleB) { + return -1; + } + + return 0; + }); + } + ); +} + function createMatchingDelayProfilesSelector() { return createSelector( (state, { delayProfileIds }) => delayProfileIds,