Sort series by title in task name

This commit is contained in:
Bogdan 2024-03-14 14:35:22 +02:00 committed by Mark McDowall
parent e14568adef
commit 172b1a82d1
1 changed files with 5 additions and 2 deletions

View File

@ -23,13 +23,16 @@ export default function QueuedTaskRowNameCell(
}
const series = useSelector(createMultiSeriesSelector(seriesIds));
const sortedSeries = series.sort((a, b) =>
a.sortTitle.localeCompare(b.sortTitle)
);
return (
<TableRowCell>
<span className={styles.commandName}>
{commandName}
{series.length ? (
<span> - {series.map((s) => s.title).join(', ')}</span>
{sortedSeries.length ? (
<span> - {sortedSeries.map((s) => s.title).join(', ')}</span>
) : null}
{body.seasonNumber ? (
<span>