Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const useQueueDataFetching = ({
initialSize: searchParams.page ? searchParams.page + 1 : 1,
});

const hasMoreResults = data && data[0] && size * PAGE_LIMIT < data[0].totalCount;
const hasMoreResults = Boolean(data && data[0] && size * PAGE_LIMIT < data[0].totalCount);
const totalSearchResultCount = (data && data[0] && data[0].totalCount) || null;

const climbSearchResults = useMemo(
Expand Down Expand Up @@ -102,7 +102,7 @@ export const useQueueDataFetching = ({
}, [climbSearchResults, hasDoneFirstFetch, setHasDoneFirstFetch]);

const fetchMoreClimbs = useCallback(() => {
setSize((oldSize) => {
return setSize((oldSize) => {
const newParams = { ...searchParams, page: oldSize + 1 };
history.replaceState(null, '', `${window.location.pathname}?${searchParamsToUrlParams(newParams).toString()}`);
return oldSize + 1;
Expand Down
2 changes: 1 addition & 1 deletion packages/web/app/components/queue-control/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export interface QueueContextType {
setCurrentClimbQueueItem: (item: ClimbQueueItem) => void;
setClimbSearchParams: (params: SearchRequestPagination) => void;
mirrorClimb: () => void;
fetchMoreClimbs: () => void;
fetchMoreClimbs: () => Promise<unknown>;
getNextClimbQueueItem: () => ClimbQueueItem | null;
getPreviousClimbQueueItem: () => ClimbQueueItem | null;
setQueue: (queue: ClimbQueueItem[]) => void;
Expand Down