Skip to content

Commit

Permalink
Stream pagination, page number bug fix (#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
praveen5959 authored Nov 1, 2024
1 parent 22ab966 commit 6b34363
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pages/Stream/Views/Explore/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ const Footer = (props: { loaded: boolean; hasNoData: boolean; isFetchingCount: b
onClick={() => {
pagination.setPage(page);
}}>
{(perPage ? page + currentOffset / perPage : page) ?? 1}
{(perPage ? Math.ceil(page + currentOffset / perPage) : page) ?? 1}
</Pagination.Control>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Stream/providers/LogsProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ const initialState: LogsStore = {
const { Provider: LogsProvider, useStore: useLogsStore } = initContext(initialState);

const getTotalPages = (data: Log[], perPage: number) => {
return _.isEmpty(data) ? 0 : _.size(data) / perPage;
return _.isEmpty(data) ? 0 : Math.ceil(_.size(data) / perPage);
};

const setSelectedLog = (_store: LogsStore, log: Log | null) => {
Expand Down

0 comments on commit 6b34363

Please sign in to comment.