Skip to content

Commit

Permalink
Merge pull request #3084 from threefoldtech/development_enhance_pagin…
Browse files Browse the repository at this point in the history
…ation

Reduce getting pages count in listing
  • Loading branch information
0oM4R authored Jul 10, 2024
2 parents 8b11c19 + f33c626 commit cd929e2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/playground/src/utils/nodeSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,9 @@ export async function selectValidNode(
}

export async function getNodePageCount(gridStore: ReturnType<typeof useGrid>, filters: FarmFilterOptions) {
const count = await gridStore.client.capacity.getNodesCount(filters);
const clonedFilter = { ...filters };
clonedFilter.size = 0;
const count = await gridStore.client.capacity.getNodesCount(clonedFilter);
return Math.ceil(count / window.env.PAGE_SIZE);
}

Expand Down

0 comments on commit cd929e2

Please sign in to comment.