From d0e9504af0d88391a74e04b90638e4b2d99fb476 Mon Sep 17 00:00:00 2001 From: CheAle14 <12370876+CheAle14@users.noreply.github.com> Date: Sun, 3 Mar 2024 15:37:20 +0000 Subject: [PATCH] Fix import list exclusion props --- frontend/src/App/State/AppSectionState.ts | 1 + .../ImportListExclusions/ImportListExclusions.tsx | 12 +++++------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/frontend/src/App/State/AppSectionState.ts b/frontend/src/App/State/AppSectionState.ts index 5bc7dfbac..30af90d34 100644 --- a/frontend/src/App/State/AppSectionState.ts +++ b/frontend/src/App/State/AppSectionState.ts @@ -19,6 +19,7 @@ export interface AppSectionSaveState { export interface PagedAppSectionState { pageSize: number; + totalRecords?: number; } export interface AppSectionFilterState { diff --git a/frontend/src/Settings/ImportLists/ImportListExclusions/ImportListExclusions.tsx b/frontend/src/Settings/ImportLists/ImportListExclusions/ImportListExclusions.tsx index 7a15bca91..8c7033686 100644 --- a/frontend/src/Settings/ImportLists/ImportListExclusions/ImportListExclusions.tsx +++ b/frontend/src/Settings/ImportLists/ImportListExclusions/ImportListExclusions.tsx @@ -1,5 +1,6 @@ import React, { useCallback, useEffect } from 'react'; import { useDispatch, useSelector } from 'react-redux'; +import { useHistory } from 'react-router'; import { createSelector } from 'reselect'; import AppState from 'App/State/AppState'; import FieldSet from 'Components/FieldSet'; @@ -41,11 +42,6 @@ const COLUMNS = [ }, ]; -interface ImportListExclusionsProps { - useCurrentPage: number; - totalRecords: number; -} - function createImportListExlucionsSelector() { return createSelector( (state: AppState) => state.settings.importListExclusions, @@ -57,8 +53,9 @@ function createImportListExlucionsSelector() { ); } -function ImportListExclusions(props: ImportListExclusionsProps) { - const { useCurrentPage, totalRecords } = props; +function ImportListExclusions() { + const history = useHistory(); + const useCurrentPage = history.action === 'POP'; const dispatch = useDispatch(); @@ -155,6 +152,7 @@ function ImportListExclusions(props: ImportListExclusionsProps) { sortKey, error, sortDirection, + totalRecords, ...otherProps } = selected;