Skip to content

Commit

Permalink
Fix paging
Browse files Browse the repository at this point in the history
  • Loading branch information
gafetinov committed Dec 12, 2023
1 parent 32aa40b commit de39963
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ export const TasksPageContainer = ({
const onChangeFilter = (value: Partial<RtqMonitoringSearchRequest>) => setRequest({ ...request, ...value });

const isStateCompletelyLoaded = results && availableTaskNames;
const count = request.count || maxTaskCountOnPage;
const offset = request.offset || 0;
const counter = Number((results && results.totalCount) || 0);
const massActionTarget = chosenTasks.size > 0 ? "Chosen" : "All";
Expand Down Expand Up @@ -249,11 +248,11 @@ export const TasksPageContainer = ({
/>
</Fit>
<Fit>
{Math.ceil(counter / count) > 1 && (
{Math.ceil(counter / maxTaskCountOnPage) > 1 && (
<Paging
data-tid="Paging"
activePage={Math.floor(offset / count) + 1}
pagesCount={Math.ceil(Math.min(counter, 10000) / count)}
activePage={Math.floor(offset / maxTaskCountOnPage) + 1}
pagesCount={Math.ceil(Math.min(counter, 10000) / maxTaskCountOnPage)}
onPageChange={goToPage}
/>
)}
Expand Down

0 comments on commit de39963

Please sign in to comment.