Fix import list exclusion props

This commit is contained in:
CheAle14 2024-03-03 15:37:20 +00:00 committed by Mark McDowall
parent e81bb3b993
commit d0e9504af0
2 changed files with 6 additions and 7 deletions

View File

@ -19,6 +19,7 @@ export interface AppSectionSaveState {
export interface PagedAppSectionState { export interface PagedAppSectionState {
pageSize: number; pageSize: number;
totalRecords?: number;
} }
export interface AppSectionFilterState<T> { export interface AppSectionFilterState<T> {

View File

@ -1,5 +1,6 @@
import React, { useCallback, useEffect } from 'react'; import React, { useCallback, useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux'; import { useDispatch, useSelector } from 'react-redux';
import { useHistory } from 'react-router';
import { createSelector } from 'reselect'; import { createSelector } from 'reselect';
import AppState from 'App/State/AppState'; import AppState from 'App/State/AppState';
import FieldSet from 'Components/FieldSet'; import FieldSet from 'Components/FieldSet';
@ -41,11 +42,6 @@ const COLUMNS = [
}, },
]; ];
interface ImportListExclusionsProps {
useCurrentPage: number;
totalRecords: number;
}
function createImportListExlucionsSelector() { function createImportListExlucionsSelector() {
return createSelector( return createSelector(
(state: AppState) => state.settings.importListExclusions, (state: AppState) => state.settings.importListExclusions,
@ -57,8 +53,9 @@ function createImportListExlucionsSelector() {
); );
} }
function ImportListExclusions(props: ImportListExclusionsProps) { function ImportListExclusions() {
const { useCurrentPage, totalRecords } = props; const history = useHistory();
const useCurrentPage = history.action === 'POP';
const dispatch = useDispatch(); const dispatch = useDispatch();
@ -155,6 +152,7 @@ function ImportListExclusions(props: ImportListExclusionsProps) {
sortKey, sortKey,
error, error,
sortDirection, sortDirection,
totalRecords,
...otherProps ...otherProps
} = selected; } = selected;