Use sorted section selector in RootFolders

Fixes #3918
This commit is contained in:
Bogdan 2023-07-29 05:28:30 +03:00
parent 6372764f61
commit abbb5e9bcb
2 changed files with 4 additions and 2 deletions

View File

@ -55,7 +55,7 @@ class RootFolders extends Component {
>
<div className={styles.rootFolders}>
{
items.sort(sortByName).map((item) => {
items.map((item) => {
const qualityProfile = qualityProfiles.find((profile) => profile.id === item.defaultQualityProfileId);
const metadataProfile = metadataProfiles.find((profile) => profile.id === item.defaultMetadataProfileId);
return (

View File

@ -3,11 +3,13 @@ import React, { Component } from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import { deleteRootFolder, fetchRootFolders } from 'Store/Actions/settingsActions';
import createSortedSectionSelector from 'Store/Selectors/createSortedSectionSelector';
import sortByName from 'Utilities/Array/sortByName';
import RootFolders from './RootFolders';
function createMapStateToProps() {
return createSelector(
(state) => state.settings.rootFolders,
createSortedSectionSelector('settings.rootFolders', sortByName),
(state) => state.settings.qualityProfiles,
(state) => state.settings.metadataProfiles,
(rootFolders, quality, metadata) => {