From 67822e621415405350059c45addfaa169db02e76 Mon Sep 17 00:00:00 2001 From: Qstick Date: Fri, 2 Oct 2020 23:06:06 -0400 Subject: [PATCH] Fixed: Tag details list series in alphabetical order Co-Authored-By: Mark McDowall --- .../TagDetailsModalContentConnector.js | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/frontend/src/Settings/Tags/Details/TagDetailsModalContentConnector.js b/frontend/src/Settings/Tags/Details/TagDetailsModalContentConnector.js index 18a3fb435..39c68d5f9 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 createMatchingArtistSelector() { +function createUnorderedMatchingArtistSelector() { return createSelector( (state, { artistIds }) => artistIds, createAllArtistSelector(), @@ -17,6 +17,26 @@ function createMatchingArtistSelector() { ); } +function createMatchingArtistSelector() { + return createSelector( + createUnorderedMatchingArtistSelector(), + (artists) => { + return artists.sort((artistA, artistB) => { + const sortNameA = artistA.sortName; + const sortNameB = artistB.sortName; + + if (sortNameA > sortNameB) { + return 1; + } else if (sortNameA < sortNameB) { + return -1; + } + + return 0; + }); + } + ); +} + function createMatchingDelayProfilesSelector() { return createSelector( (state, { delayProfileIds }) => delayProfileIds,