Skip to content

Commit c6b52bb

Browse files
authored
Merge pull request #984 from devtron-labs/fix/table-bulk
fix: remove unused bulk selection identifiers for multi page selection
2 parents c96dd1e + 8f66725 commit c6b52bb

1 file changed

Lines changed: 1 addition & 23 deletions

File tree

src/Shared/Components/Table/InternalTable.tsx

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { UseRegisterShortcutProvider } from '@Common/Hooks'
2424

2525
import { NO_ROWS_OR_GET_ROWS_ERROR } from './constants'
2626
import TableContent from './TableContent'
27-
import { FiltersTypeEnum, InternalTableProps, PaginationEnum, RowsResultType } from './types'
27+
import { FiltersTypeEnum, InternalTableProps, RowsResultType } from './types'
2828
import { getFilteringPromise, searchAndSortRows } from './utils'
2929

3030
const InternalTable = <
@@ -79,8 +79,6 @@ const InternalTable = <
7979

8080
const wrapperDivRef = useRef<HTMLDivElement>(null)
8181

82-
const { setIdentifiers } = bulkSelectionReturnValue ?? {}
83-
8482
const searchSortTimeoutRef = useRef<number>(-1)
8583

8684
useEffect(() => {
@@ -182,26 +180,6 @@ const InternalTable = <
182180

183181
const areFilteredRowsLoading = _areFilteredRowsLoading || filteredRowsError === NO_ROWS_OR_GET_ROWS_ERROR
184182

185-
const visibleRows = useMemo(() => {
186-
const normalizedFilteredRows = filteredRows ?? []
187-
188-
const paginatedRows =
189-
paginationVariant !== PaginationEnum.PAGINATED
190-
? normalizedFilteredRows
191-
: normalizedFilteredRows.slice(offset, offset + pageSize)
192-
193-
return paginatedRows
194-
}, [paginationVariant, offset, pageSize, filteredRows])
195-
196-
useEffect(() => {
197-
setIdentifiers?.(
198-
visibleRows.reduce((acc, row) => {
199-
acc[row.id] = row
200-
return acc
201-
}, {}),
202-
)
203-
}, [visibleRows])
204-
205183
const Wrapper = ViewWrapper ?? Fragment
206184

207185
const renderContent = () => {

0 commit comments

Comments
 (0)