Fixed: Tag details list series in alphabetical order

This commit is contained in:
Mark McDowall 2020-05-08 17:10:07 -07:00
parent 7ffb2eb440
commit 36088ef49d
1 changed files with 21 additions and 1 deletions

View File

@ -9,7 +9,7 @@ function findMatchingItems(ids, items) {
}); });
} }
function createMatchingSeriesSelector() { function createUnorderedMatchingSeriesSelector() {
return createSelector( return createSelector(
(state, { seriesIds }) => seriesIds, (state, { seriesIds }) => seriesIds,
createAllSeriesSelector(), 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() { function createMatchingDelayProfilesSelector() {
return createSelector( return createSelector(
(state, { delayProfileIds }) => delayProfileIds, (state, { delayProfileIds }) => delayProfileIds,