Skip to content

Commit 6b34363

Browse files
authored
Stream pagination, page number bug fix (#353)
1 parent 22ab966 commit 6b34363

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/pages/Stream/Views/Explore/Footer.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ const Footer = (props: { loaded: boolean; hasNoData: boolean; isFetchingCount: b
154154
onClick={() => {
155155
pagination.setPage(page);
156156
}}>
157-
{(perPage ? page + currentOffset / perPage : page) ?? 1}
157+
{(perPage ? Math.ceil(page + currentOffset / perPage) : page) ?? 1}
158158
</Pagination.Control>
159159
);
160160
}

src/pages/Stream/providers/LogsProvider.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ const initialState: LogsStore = {
359359
const { Provider: LogsProvider, useStore: useLogsStore } = initContext(initialState);
360360

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

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

0 commit comments

Comments
 (0)