Appease linter
This commit is contained in:
parent
513b746fc3
commit
3b5e83670b
|
@ -1,9 +1,9 @@
|
|||
import { reduce } from 'lodash';
|
||||
import PropTypes from 'prop-types';
|
||||
import React, { Component } from 'react';
|
||||
import LoadingIndicator from 'Components/Loading/LoadingIndicator';
|
||||
import PageContent from 'Components/Page/PageContent';
|
||||
import PageContentBody from 'Components/Page/PageContentBody';
|
||||
import getSelectedIds from 'Utilities/Table/getSelectedIds';
|
||||
import selectAll from 'Utilities/Table/selectAll';
|
||||
import toggleSelected from 'Utilities/Table/toggleSelected';
|
||||
import ImportSeriesFooterConnector from './ImportSeriesFooterConnector';
|
||||
|
@ -31,7 +31,17 @@ class ImportSeries extends Component {
|
|||
// Listeners
|
||||
|
||||
getSelectedIds = () => {
|
||||
return getSelectedIds(this.state.selectedState, { parseIds: false });
|
||||
return reduce(
|
||||
this.state.selectedState,
|
||||
(result, value, id) => {
|
||||
if (value) {
|
||||
result.push(id);
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
[]
|
||||
);
|
||||
};
|
||||
|
||||
onSelectAllChange = ({ value }) => {
|
||||
|
|
|
@ -23,6 +23,15 @@ import ChangeMonitoringModal from './SeasonPass/ChangeMonitoringModal';
|
|||
import TagsModal from './Tags/TagsModal';
|
||||
import styles from './SeriesIndexSelectFooter.css';
|
||||
|
||||
interface SavePayload {
|
||||
monitored?: boolean;
|
||||
qualityProfileId?: number;
|
||||
seriesType?: string;
|
||||
seasonFolder?: boolean;
|
||||
rootFolderPath?: string;
|
||||
moveFiles?: boolean;
|
||||
}
|
||||
|
||||
const seriesEditorSelector = createSelector(
|
||||
(state: AppState) => state.series,
|
||||
(series) => {
|
||||
|
@ -74,7 +83,7 @@ function SeriesIndexSelectFooter() {
|
|||
}, [setIsEditModalOpen]);
|
||||
|
||||
const onSavePress = useCallback(
|
||||
(payload: any) => {
|
||||
(payload: SavePayload) => {
|
||||
setIsSavingSeries(true);
|
||||
setIsEditModalOpen(false);
|
||||
|
||||
|
@ -161,7 +170,6 @@ function SeriesIndexSelectFooter() {
|
|||
|
||||
useEffect(() => {
|
||||
if (previousIsDeleting && !isDeleting && !deleteError) {
|
||||
|
||||
selectDispatch({ type: 'unselectAll' });
|
||||
}
|
||||
}, [previousIsDeleting, isDeleting, deleteError, selectDispatch]);
|
||||
|
|
|
@ -1,18 +1,12 @@
|
|||
import { reduce } from 'lodash';
|
||||
import { SelectedState } from 'Helpers/Hooks/useSelectState';
|
||||
|
||||
// TODO: This needs to handle string IDs as well
|
||||
function getSelectedIds(
|
||||
selectedState: SelectedState,
|
||||
{ parseIds = true } = {}
|
||||
): number[] {
|
||||
function getSelectedIds(selectedState: SelectedState): number[] {
|
||||
return reduce(
|
||||
selectedState,
|
||||
(result: any[], value, id) => {
|
||||
(result: number[], value, id) => {
|
||||
if (value) {
|
||||
const parsedId = parseIds ? parseInt(id) : id;
|
||||
|
||||
result.push(parsedId);
|
||||
result.push(parseInt(id));
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
Loading…
Reference in New Issue