mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Fixed: Editing provider/profile settings appearing to affect wrong item
This commit is contained in:
16
frontend/src/Store/Selectors/createSortedSectionSelector.js
Normal file
16
frontend/src/Store/Selectors/createSortedSectionSelector.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import { createSelector } from 'reselect';
|
||||
import getSectionState from 'Utilities/State/getSectionState';
|
||||
function createSortedSectionSelector(section, comparer) {
|
||||
return createSelector(
|
||||
(state) => state,
|
||||
(state) => {
|
||||
const sectionState = getSectionState(state, section, true);
|
||||
return {
|
||||
...sectionState,
|
||||
items: [...sectionState.items].sort(comparer)
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export default createSortedSectionSelector;
|
Reference in New Issue
Block a user