Fixed: Indexer Index enabled count in footer

pull/10/head
Qstick 3 years ago
parent d8cc1094c4
commit 6ef9c9003c

@ -22,9 +22,9 @@ import translate from 'Utilities/String/translate';
import getSelectedIds from 'Utilities/Table/getSelectedIds';
import selectAll from 'Utilities/Table/selectAll';
import toggleSelected from 'Utilities/Table/toggleSelected';
import IndexerIndexFooterConnector from './IndexerIndexFooterConnector';
import MovieIndexFilterMenu from './Menus/MovieIndexFilterMenu';
import MovieIndexSortMenu from './Menus/MovieIndexSortMenu';
import MovieIndexFooterConnector from './MovieIndexFooterConnector';
import MovieIndexTableConnector from './Table/MovieIndexTableConnector';
import MovieIndexTableOptionsConnector from './Table/MovieIndexTableOptionsConnector';
import styles from './IndexerIndex.css';
@ -422,7 +422,7 @@ class IndexerIndex extends Component {
{
!isMovieEditorActive &&
<MovieIndexFooterConnector />
<IndexerIndexFooterConnector />
}
</div>
}

@ -4,9 +4,9 @@ import React, { PureComponent } from 'react';
import DescriptionList from 'Components/DescriptionList/DescriptionList';
import DescriptionListItem from 'Components/DescriptionList/DescriptionListItem';
import translate from 'Utilities/String/translate';
import styles from './MovieIndexFooter.css';
import styles from './IndexerIndexFooter.css';
class MovieIndexFooter extends PureComponent {
class IndexerIndexFooter extends PureComponent {
render() {
const {
@ -15,13 +15,13 @@ class MovieIndexFooter extends PureComponent {
} = this.props;
const count = movies.length;
let movieFiles = 0;
let enabled = 0;
let torrent = 0;
movies.forEach((s) => {
if (s.hasFile) {
movieFiles += 1;
if (s.enable) {
enabled += 1;
}
if (s.protocol === 'torrent') {
@ -67,7 +67,7 @@ class MovieIndexFooter extends PureComponent {
<DescriptionListItem
title={translate('Enabled')}
data={movieFiles}
data={enabled}
/>
</DescriptionList>
@ -88,9 +88,9 @@ class MovieIndexFooter extends PureComponent {
}
}
MovieIndexFooter.propTypes = {
IndexerIndexFooter.propTypes = {
movies: PropTypes.arrayOf(PropTypes.object).isRequired,
colorImpairedMode: PropTypes.bool.isRequired
};
export default MovieIndexFooter;
export default IndexerIndexFooter;

@ -3,7 +3,7 @@ import { createSelector } from 'reselect';
import createClientSideCollectionSelector from 'Store/Selectors/createClientSideCollectionSelector';
import createDeepEqualSelector from 'Store/Selectors/createDeepEqualSelector';
import createUISettingsSelector from 'Store/Selectors/createUISettingsSelector';
import MovieIndexFooter from './MovieIndexFooter';
import IndexerIndexFooter from './IndexerIndexFooter';
function createUnoptimizedSelector() {
return createSelector(
@ -12,12 +12,14 @@ function createUnoptimizedSelector() {
return indexers.items.map((s) => {
const {
protocol,
privacy
privacy,
enable
} = s;
return {
protocol,
privacy
privacy,
enable
};
});
}
@ -44,4 +46,4 @@ function createMapStateToProps() {
);
}
export default connect(createMapStateToProps)(MovieIndexFooter);
export default connect(createMapStateToProps)(IndexerIndexFooter);
Loading…
Cancel
Save