1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-14 11:23:42 +02:00

Fixed: Series footer shows statistics based on filtered series list

This commit is contained in:
Mark McDowall 2019-04-12 19:05:23 -07:00
parent 24fba7a36d
commit 889f92268e

View File

@ -1,10 +1,40 @@
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import createDeepEqualSelector from 'Store/Selectors/createDeepEqualSelector';
import createClientSideCollectionSelector from 'Store/Selectors/createClientSideCollectionSelector';
import SeriesIndexFooter from './SeriesIndexFooter';
function createUnoptimizedSelector() {
return createSelector(
createClientSideCollectionSelector('series', 'seriesIndex'),
(series) => {
return series.items.map((s) => {
const {
monitored,
status,
statistics
} = s;
return {
monitored,
status,
statistics
};
});
}
);
}
function createSeriesSelector() {
return createDeepEqualSelector(
createUnoptimizedSelector(),
(series) => series
);
}
function createMapStateToProps() {
return createSelector(
(state) => state.series.items,
createSeriesSelector(),
(series) => {
return {
series